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 in Turbo C? #include
int main() { char str[10] = "India"; str[6] = "CURIOUSTAB"; printf("%s\n", str); return 0; }
India CURIOUSTAB
CURIOUSTAB
India
Error
Correct Answer:
Error
Explanation:
str[6] = "CURIOUSTAB";
- Nonportable pointer conversion.
← Previous Question
Next Question→
More Questions from
Strings
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; }
What will be the output of the program? #include
int main() { static char mess[6][30] = {"Don't walk in front of me...", "I may not follow;", "Don't walk behind me...", "Just walk beside me...", "And be my friend." }; printf("%c, %c\n", *(mess[2]+9), *(*(mess+2)+9)); return 0; }
What will be the output of the program in 16-bit platform (Turbo C under DOS)? #include
int main() { printf("%d, %d, %d", sizeof(3.0f), sizeof('3'), sizeof(3.0)); return 0; }
If the size of pointer is 32 bits What will be the output of the program? #include
int main() { char a[] = "Visual C++"; char *b = "Visual C++"; printf("%d, %d\n", sizeof(a), sizeof(b)); printf("%d, %d", sizeof(*a), sizeof(*b)); return 0; }
What will be the output of the program? #include
int main() { char str[7] = "CuriousTab"; printf("%s\n", str); return 0; }
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment
Join Discussion
Discussion & Comments