Skip to content

Instantly share code, notes, and snippets.

@sayantanHack
Created January 18, 2019 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sayantanHack/78aa86e650f1d95a388b7b86ec085113 to your computer and use it in GitHub Desktop.
Save sayantanHack/78aa86e650f1d95a388b7b86ec085113 to your computer and use it in GitHub Desktop.
adding array elements & showing them
#include<stdio.h>
int main(void){
int i, nums[50], n;
printf("Enter the number of the array, array size max is 50 : ");
scanf("%d",&n);
// addding numbers to the array
for(i=0;i<n;i++){
scanf("%d",&nums[i]);
}
//showing the array
for(i=0;i<n;i++){
printf("%d ",nums[i]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment