enum colors {BLACK,BLUE,GREEN}
main()
{
printf("%d..%d..%d",BLACK,BLUE,GREEN);
return(1);
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
0..1..2
Explanation:
enum assigns numbers starting from 0, if not
explicitly defined.
| Is This Answer Correct ? | 5 Yes | 0 No |
main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcat(a,b)); } a. Hello b. Hello World c. HelloWorld d. None of the above
main() { char str1[] = {‘s’,’o’,’m’,’e’}; char str2[] = {‘s’,’o’,’m’,’e’,’\0’}; while (strcmp(str1,str2)) printf(“Strings are not equal\n”); }
program to Reverse a linked list
12 Answers Aricent, Microsoft, Ness Technologies,
main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }
29 Answers IBM, TCS, UGC NET, Wipro,
main( ) { char *q; int j; for (j=0; j<3; j++) scanf(“%s” ,(q+j)); for (j=0; j<3; j++) printf(“%c” ,*(q+j)); for (j=0; j<3; j++) printf(“%s” ,(q+j)); }
C program to print magic square of order n where n > 3 and n is odd
main() { int *j; { int i=10; j=&i; } printf("%d",*j); }
1. const char *a; 2. char* const a; 3. char const *a; -Differentiate the above declarations.
main() { char *cptr,c; void *vptr,v; c=10; v=0; cptr=&c; vptr=&v; printf("%c%v",c,v); }
main(){ int a= 0;int b = 20;char x =1;char y =10; if(a,b,x,y) printf("hello"); }
char *someFun() { char *temp = “string constant"; return temp; } int main() { puts(someFun()); }
main() { int i=300; char *ptr = &i; *++ptr=2; printf("%d",i); }