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.
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 |
#include<stdio.h> int main() { int a=3,post,pre; post= a++ * a++ * a++; a=3; pre= ++a * ++a * ++a; printf("post=%d pre=%d",post,pre); return 0; }
main() { float i=1.5; switch(i) { case 1: printf("1"); case 2: printf("2"); default : printf("0"); } }
main() { int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }
void main() { int i=5; printf("%d",i++ + ++i); }
main() { char str1[] = {‘s’,’o’,’m’,’e’}; char str2[] = {‘s’,’o’,’m’,’e’,’\0’}; while (strcmp(str1,str2)) printf(“Strings are not equal\n”); }
Write a C program to print ‘Campus Force training’ without using even a single semicolon in the program.
main() { unsigned char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
main() { char *p; p="Hello"; printf("%c\n",*&*p); }
Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without making use of any floating point computations at all.
2 Answers Mentor Graphics, Microsoft,
Finding a number multiplication of 8 with out using arithmetic operator
how can i search an element in an array
2 Answers CTS, Microsoft, ViPrak,
main() { float f=5,g=10; enum{i=10,j=20,k=50}; printf("%d\n",++k); printf("%f\n",f<<2); printf("%lf\n",f%g); printf("%lf\n",fmod(f,g)); }