Write a program using one dimensional array to assign values and then display it on the screen. Use the formula a[i]=i*10 to assign value to an element.



Write a program using one dimensional array to assign values and then display it on the screen. Use ..

Answer / ram

#include<stdio.h>
#define M 3
main()
{
int i,a[M];
for(i=0;<M;i++)
a[i]=i*10;
for(i=0;<M;i++)
printf("%d ",a[i]);

}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Code Interview Questions

Write a function to find the depth of a binary tree.

13 Answers   Adobe, Amazon, EFI, Imagination Technologies,


can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail

0 Answers   TCS,


main() { int i=1; while (i<=5) { printf("%d",i); if (i>2) goto here; i++; } } fun() { here: printf("PP"); }

1 Answers  


write a c-program to find gcd using recursive functions

5 Answers   HTC, Infotech,


Write a prog to accept a given string in any order and flash error if any of the character is different. For example : If abc is the input then abc, bca, cba, cab bac are acceptable, but aac or bcd are unacceptable.

5 Answers   Amazon, Microsoft,






abcdedcba abc cba ab ba a a

2 Answers  


writte a c-programm to display smill paces

2 Answers  


why the range of an unsigned integer is double almost than the signed integer.

1 Answers  


main() { char * strA; char * strB = I am OK; memcpy( strA, strB, 6); } a. Runtime error. b. I am OK c. Compile error d. I am O

4 Answers   HCL,


Who could write how to find a prime number in dynamic array?

1 Answers  


#define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }

4 Answers   Google, HCL, Quick Heal, WTF,


main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }

2 Answers  


Categories