TCS
Company
Programming
Basics
Guess the output:
main()
{
printf(“n ks”);
printf(“b mi a”);
printf(“r ha n”);
}
1. ksmiha
2. mis
3. hai
4. hamiks
Read Solution (Total 9)
-
- I don't understand the catch here. the output should be "n ksb mi ar ha n"
- 6 years agoHelpfull: Yes(11) No(1)
- I am assuming that statements are like this.
printf("n ks");
printf("b mi a");
printf("r ha n");
If that is the case then output will be
ha i
because ks will be printed according to first statement. Then b will erase the one character, a will not produce any effect it will just give you a beep sound and the r will go the back row and start printing again. - 6 years agoHelpfull: Yes(3) No(2)
- "n ksb mi ar ha n".The string written in the quotation will be the right answer.And this is not given as the option.But I am shocked if their is no option provided than how company will evaluate this type of questions.
- 6 years agoHelpfull: Yes(2) No(0)
- dummy questions to waste time in the examination
- 6 years agoHelpfull: Yes(2) No(0)
- n ksb mi ar ha n
- 6 years agoHelpfull: Yes(1) No(0)
- n ksb mi ar ha n
this will be the output of the program - 6 years agoHelpfull: Yes(0) No(0)
- output 3-hai n,b,a,r thesea are special characters was missing from all
- 6 years agoHelpfull: Yes(0) No(0)
- i think there is an error as in an escape character is missing.
if the question is right then the output should be "n ksb mi ar ha n".
By considering the escape character:
output: ha i - 5 years agoHelpfull: Yes(0) No(0)
- The output should be "n ksb mi ar ha n". I have run the code
- 5 years agoHelpfull: Yes(0) No(0)
TCS Other Question