Horje
Arrays in C Code Example
take array as input in c
int size=5;
int array[size]; // array of size=5;

for(i=0;i<size;i++){
   scanf("%d",&array[i]);
                }
arrays in c
#include<stdio.h>
void main()
{
    int arr[100];
    int i,n;
    printf("Enter array size:");
    scanf("%d",&n);
    printf("Enter array elaments:");
    for(i=0;i<n;i=i+1)
    {
        scanf("%d",&arr[i]);
    }
    printf("Array elements are:");
    for(i=0;i<n;i=i+1)
    {
        printf("%d",arr[i]);
    }
} 
array in c
int mark[5] = {19, 10, 8, 17, 9};
c arrays
float mark[5];
Arrays in C
#include <stdio.h>
void display(int age1, int age2)
{
    printf("%d\n", age1);
    printf("%d\n", age2);
}

int main()
{
    int ageArray[] = {2, 8, 4, 12};

    // Passing second and third elements to display()
    display(ageArray[1], ageArray[2]); 
    return 0;
}




C

Related
xor in c Code Example xor in c Code Example
helloworld c Code Example helloworld c Code Example
formula to find the area of a trapezium in c Code Example formula to find the area of a trapezium in c Code Example
passing a pointer to a function Code Example passing a pointer to a function Code Example
how to stop scanf from adding a new line in c Code Example how to stop scanf from adding a new line in c Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7