Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

send me the body of array program??

0 votes
asked Nov 12, 2017 by Fizza Sajjad (300 points)

3 Answers

0 votes
answered Nov 12, 2017 by Swastik Chakrabarti (220 points)
/* Program to print an array initialized within the program*/

#include<stdio.h>

void main()

{
int a[5],i;

a={1,2,3,4,5,6}

printf("\nThe array is:\n");

for(i=0;i<n;i++)

{

printf("%d",a[i]);

}

getch();

}
0 votes
answered Nov 12, 2017 by Swastik Chakrabarti (220 points)
/* program to print an array whose elements supplied externally*/

#include<stdio.h>

void main()

{

int n,a[50],i;

printf("\n Enter the size of the array <=50:\n");

scanf("%d", &n );

printf("\n Enter the elements:\n");

for(i=0;i<n;i++)

{

scanf("%d", &a[i]);

}

printf("\n The array of size %d is entered by you is:\n",n);

for(i=0;i<n;i++)

{

printf("%d\n", a[i]);

}

getch();

}
0 votes
answered Nov 12, 2017 by Swastik Chakrabarti (220 points)
These codes are for windows environment
commented Nov 13, 2017 by Fizza Sajjad (300 points)
reshown Nov 14, 2017 by Fizza Sajjad
THANX FOR SENDING ME THIS
commented Nov 13, 2017 by Swastik Chakrabarti (220 points)
Happy to help!! :))
commented Nov 14, 2017 by Fizza Sajjad (300 points)
hahahahah god bless you from fiya khan
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...