How do you write int Array in C programming examples

Array in C programming examples

Hello, student today we learn about the intArray Program in C, Previous we already learned 2D (Two Dimensional Array) and Many different Array Related Programs.

Thank you for reading this post, don't forget to subscribe!

How do you write an int array

#include <stdio.h>

#include <conio.h>
int main()
{

printf("Welcome to Thesmolt\n\n");

int size_of_array, iteration;
int *array;//defining array as pointer
printf("Enter the size of the array: ");
scanf("%d", &size_of_array);
printf("Enter the elements of the array:\n");
for(iteration = 0 ; iteration < size_of_array ; iteration ++ )
{
scanf("%d", &array[iteration]);
}
printf("The array is:\n");
for(iteration = 0 ; iteration < size_of_array ; iteration ++ )
{
printf("The element at index %d is: %d\n",iteration, array[iteration]);
}
return 0;
}

Output

Welcome to Thesmolt

Example of Int array

Array in C programming examples

Array declaration in C

int *array; this is not array unless you dynamically assign memory to it, int *array means it can point to a memory address where int is stored. .    For Example:-

[alert-note](a[6]; //int  Array[/alert-note]

Int Array Program

END

Saurabh Nissa

This is SaurabhNissa, Owner of Thesmolt.com I'm Graduated from Magadh University in 2019 with 75%. Currently, I'm working on my Personal educational website for teaching Programming language free of Coast, and want to provide a Full setup for Specially BCA student