Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
C Programming
»
Strings
What will be the output of the program? #include
#include
int main() { static char s[] = "Hello!"; printf("%d\n", *(s+strlen(s))); return 0; }
8
0
16
Error
Correct Answer:
0
← Previous Question
Next Question→
More Questions from
Strings
What will be the output of the program? #include
#include
int main() { char str1[20] = "Hello", str2[20] = " World"; printf("%s\n", strcpy(str2, strcat(str1, str2))); return 0; }
What will be the output of the program? #include
int main() { char str1[] = "Hello"; char str2[] = "Hello"; if(str1 == str2) printf("Equal\n"); else printf("Unequal\n"); return 0; }
What will be the output of the program? #include
#include
int main() { char str[] = "India\0\CURIOUSTAB\0"; printf("%d\n", strlen(str)); return 0; }
What will be the output of the program? #include
#include
int main() { char str[] = "India\0\CURIOUSTAB\0"; printf("%s\n", str); return 0; }
What will be the output of the program? #include
#include
int main() { char str1[5], str2[5]; int i; gets(str1); gets(str2); i = strcmp(str1, str2); printf("%d\n", i); return 0; }
What will be the output of the program? #include
int main() { printf("India", "CURIOUSTAB\n"); return 0; }
What will be the output of the program? #include
int main() { char *names[] = { "Suresh", "Siva", "Sona", "Baiju", "Ritu"}; int i; char *t; t = names[3]; names[3] = names[4]; names[4] = t; for(i=0; i<=4; i++) printf("%s,", names[i]); return 0; }
What will be the output of the program? #include
int main() { static char s[25] = "The cocaine man"; int i=0; char ch; ch = s[++i]; printf("%c", ch); ch = s[i++]; printf("%c", ch); ch = i++[s]; printf("%c", ch); ch = ++i[s]; printf("%c", ch); return 0; }
What will be the output of the program If characters 'a', 'b' and 'c' enter are supplied as input? #include
int main() { void fun(); fun(); printf("\n"); return 0; } void fun() { char c; if((c = getchar())!= '\n') fun(); printf("%c", c); }
What will be the output of the program? #include
#include
int main() { char sentence[80]; int i; printf("Enter a line of text\n"); gets(sentence); for(i=strlen(sentence)-1; i >=0; i--) putchar(sentence[i]); return 0; }
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment
Join Discussion
Discussion & Comments