Make a new start with a new Thought!

NOTE :                // indicates comments.This wont get printed in the output.This is used for for documentation purpose. PROGRAM: #incl...

Array

NOTE :
              
// indicates comments.This wont get printed in the output.This is used for for documentation purpose.

PROGRAM:

#include<stdlib.h>
#include<conio.h>
void main()
{
  int a[10],n,i;      //array[size]
  clrscr();
  printf("\nEnter the size of the array (max. 10)\t:\t");
  scanf("%d",&n);
  printf("Enter %d integers\t:\n",n);
  for(i=0;i<n;i++)
  {
      scanf("%d",&a[i]);                      //initializing 10 integers
  }
  printf("\nEntered elements are\t:\n");
  for(i=0;i<n;i++)
  {
      printf("%d\n",a[i]);
  }
  getch();
}

OUTPUT :


0 comments: