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 |
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.
main() { int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m); }
To reverse an entire text file into another text file.... get d file names in cmd line
#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d----%d",*p,*q); }
#define prod(a,b) a*b main() { int x=3,y=4; printf("%d",prod(x+2,y-1)); }
Finding a number which was log of base 2
#define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); }
main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above
How will u find whether a linked list has a loop or not?
main() { char *p="hai friends",*p1; p1=p; while(*p!='\0') ++*p++; printf("%s %s",p,p1); }
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.
int a=1; printf("%d %d %d",a++,a++,a); need o/p in 'c' and what explanation too