write a program to print the one dimensional array.



write a program to print the one dimensional array...

Answer / manish soni

#include<stdio.h>
#include<conio.h>
void main()
{
int
printf("enter how many no");
scanf("%d",&n);
//arrary input;
for(i=0;i<n;i++)
{
printf("Enter elements %d ",i+1);
scanf("%d",&a[i]);
}
//array output;
for(i=0;i<n;i++)
printf("output at position [%d]is=%d\n",i+1,a[i]);
getch();
}

Is This Answer Correct ?    3 Yes 3 No

Post New Answer

More C Interview Questions

How to access or modify the const variable in c ?

16 Answers   HCL, HP,


output for following code??? main() { int x=2,y,z; x*=3+2; printf("1.%d\n",x); x*=y=z=4; printf("2.%d %d %d\n",x,y,z); x=y==z; printf("3.%d\n",x); x==(y=z); printf("%d",x); }

2 Answers   Elysium,


Write code for initializing one dimentional and two dimentional array in a C Program?

5 Answers   Deshaw, Edutech, GMD,


Is a house a mass structure?

0 Answers  


What is the size of enum in bytes?

0 Answers  






increment operateor (++)and decrament(--) #include<stdio.h> #inclide<conio.h> main() { int x=15; while(x!=0) scanf("%d",&x); {

2 Answers   HCL, Syntel, TCS,


What is the difference between class and object in c?

0 Answers  


what is the output of printf("%d",(scanf("%d",10));

10 Answers  


struct node { int *a; char *b; char array[12]; }; struct node m,*n; assign the value in *a,*b,char array[12]

3 Answers  


Explain modulus operator.

0 Answers  


When should the register modifier be used? Does it really help?

0 Answers  


What is the value of h?

0 Answers  


Categories