ওয়ান ডাইমেনশনাল অ্যারে
dataType Array_Name [ size ];#include<stdio.h>
int main(void)
{
int age[5] = {18, 30, 50, 47, 57}; //array declaration and assigning values
printf("%d", age[0]); //Printing the first element
printf("\n%d", age[3]); //Printing the 4th element
age[2] = 80; //changing a value
printf("\n%d", age[2]); //printing the changed value
printf("\nEnter age of person 1 :");
scanf("%d", &age[0]); //using scanf to insert a value in the array
printf("The newly assigned age for person 1 is : %d", age[0]);
return 0;
}Last updated