Quantcast
Channel: Microcontrollers, Programming and IoT
Viewing all articles
Browse latest Browse all 1271

confuse on Size of array in c program

$
0
0
I am confuse on size of array declaration

Code:
#include<stdio.h>
int main (void)
{
  int i, array[4], size;

  /* print size of array on screen */
   printf ("size of array : ");
  /*get size of array from user */
  scanf  ("%d", &size);

  for (i = 0; i < size; i++)
  {
    /* print the element of array */
    printf("Enter element of array : " );

    /* get array element from user and them stored into array */
    scanf("%d", &array[i]);
  }

  return 0;
}
result...

confuse on Size of array in c program

Viewing all articles
Browse latest Browse all 1271

Trending Articles