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
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; }
hhe!
he c
The c
Hhec
Correct Answer:
hhe!
← Previous Question
Next Question→
More Questions from
Strings
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; }
What will be the output of the program? #include
#include
int main() { printf("%c\n", "abcdefgh"[4]); return 0; }
What will be the output of the program? #include
int main() { char str[25] = "CuriousTab"; printf("%s\n", &str+2); return 0; }
What will be the output of the program (Turbo C in 16 bit platform DOS)? #include
#include
int main() { char *str1 = "India"; char *str2 = "CURIOUSTAB"; char *str3; str3 = strcat(str1, str2); printf("%s %s\n", str3, str1); return 0; }
What will be the output of the program? #include
int main() { int i; char a[] = "\0"; if(printf("%s", a)) printf("The string is not empty\n"); else printf("The string is empty\n"); return 0; }
What will be the output of the following program in 16 bit platform assuming that 1022 is memory address of the string "Hello1" (in Turbo C under DOS)? #include
int main() { printf("%u %s\n", &"Hello1", &"Hello2"); return 0; }
If the size of pointer is 4 bytes then What will be the output of the program? #include
int main() { char *str[] = {"Frogs", "Do", "Not", "Die", "They", "Croak!"}; printf("%d, %d", sizeof(str), strlen(str[0])); return 0; }
What will be the output of the program? #include
int main() { char str[] = "Nagpur"; str[0]='K'; printf("%s, ", str); str = "Kanpur"; printf("%s", str+1); return 0; }
What will be the output of the program? #include
int main() { char p[] = "%d\n"; p[1] = 'c'; printf(p, 65); return 0; }
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment
Join Discussion
Discussion & Comments