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() { char str1[] = "Hello"; char str2[10]; char *t, *s; s = str1; t = str2; while(*t=*s) *t++ = *s++; printf("%s\n", str2); return 0; }
Hello
HelloHello
No output
ello
Correct Answer:
Hello
← Previous Question
Next Question→
More Questions from
Strings
What will be the output of the program? #include
int main() { char str = "CuriousTab"; printf("%s\n", str); return 0; }
What will be the output of the program? #include
int main() { printf(5+"CuriousTab\n"); return 0; }
What will be the output of the program? #include
#include
int main() { static char str1[] = "dills"; static char str2[20]; static char str3[] = "Daffo"; int i; i = strcmp(strcat(str3, strcpy(str2, str1)), "Daffodills"); printf("%d\n", i); return 0; }
If char=1, int=4, and float=4 bytes size, What will be the output of the program? #include
int main() { char ch = 'A'; printf("%d, %d, %d", sizeof(ch), sizeof('A'), sizeof(3.14f)); return 0; }
What will be the output of the program? #include
int main() { char t; char *p1 = "India", *p2; p2=p1; p1 = "CURIOUSTAB"; printf("%s %s\n", p1, p2); return 0; }
What will be the output of the program? #include
int main() { char str[] = "India\0CURIOUSTAB\0"; printf("%d\n", sizeof(str)); 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 empty\n"); else printf("The string is not empty\n"); return 0; }
What will be the output of the program? #include
#include
int main() { printf("%d\n", strlen("123456")); return 0; }
What will be the output of the program in Turbo C? #include
int main() { char str[10] = "India"; str[6] = "CURIOUSTAB"; printf("%s\n", str); return 0; }
What will be the output of the program? #include
void swap(char *, char *); int main() { char *pstr[2] = {"Hello", "CuriousTab"}; swap(pstr[0], pstr[1]); printf("%s\n%s", pstr[0], pstr[1]); return 0; } void swap(char *t1, char *t2) { char *t; t=t1; t1=t2; t2=t; }
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment
Join Discussion
Discussion & Comments