TCS
Company
Programming
Program
What is the output of:
#include
void main( )
{
printf ( "nn nn nnn" ) ;
printf ( "nn /n/n nn/n" ) ;
}
Read Solution (Total 33)
-
- Output : nn nn nnnnn /n/n nn/n
n ll provide a new line... But /n ll print the same /n in the o/p screen... - 10 years agoHelpfull: Yes(34) No(8)
- nothing will be changed....it will print same as in printf
nn nn nnn nn /n/n nn/n
because it is a forward slash(/) and newline character is like this(n).... - 10 years agoHelpfull: Yes(4) No(2)
- /n wil provide a new line in dis.. so oput wil b:
nn nn nnn
nn
nn - 10 years agoHelpfull: Yes(3) No(21)
- nn nn nnnnn /n/n nn/n because n provides a new lie and not /n.So otput will be in the same line.
- 10 years agoHelpfull: Yes(3) No(3)
- output:
nn nn nnnn /n/n nn/n
because here they give forward slash(/), which does not change in output. If they give backward slash() then output will change - 9 years agoHelpfull: Yes(3) No(0)
- nn nn nnnnn/n/n nn/n
- 10 years agoHelpfull: Yes(2) No(1)
- nn nn nnnnn /n/n nn/n
- 6 years agoHelpfull: Yes(2) No(0)
- nn nn nnnnn
nn - 10 years agoHelpfull: Yes(1) No(1)
- it will generate the error that bad file name format in include directive.
- 10 years agoHelpfull: Yes(1) No(0)
- nn nn nnnnn /n/n nn/n
- 9 years agoHelpfull: Yes(1) No(0)
- tell me right answer bcz widout cmplt first line ...cn it give output anyone tell me reason?????
- 10 years agoHelpfull: Yes(0) No(2)
- nn nn nnnnn
n
n nn
n - 10 years agoHelpfull: Yes(0) No(2)
- nn nn nnn
nn
/n
nn - 10 years agoHelpfull: Yes(0) No(2)
- o/P :
nn nn nnn nn /n/n nn/n
because (n) indicates the start of a new line and not forward slash n (n). - 10 years agoHelpfull: Yes(0) No(1)
- it will be
output: nn nn nnnnn /n/n nn/n
because in c compiler new line code is n so it will print in ne line. - 10 years agoHelpfull: Yes(0) No(0)
- The answer will be simply nn nn nnnnn /n/n nn/n all in the same line because its not a newline character the newline character is "n"
- 10 years agoHelpfull: Yes(0) No(0)
- nn nn nnn
nn
nn
- 10 years agoHelpfull: Yes(0) No(0)
- nn nn nnn nn nn
- 10 years agoHelpfull: Yes(0) No(0)
- /n is not used fr newline but the
will generate a new line.so the output ll be
nn nn nnn nn/n/n nn/n - 10 years agoHelpfull: Yes(0) No(0)
- it will normally print as my other friend told above but there are some problem..
if u run this program then it will not run on Dev c++ because "void main() function always want to return an integer"
Is it run on any other compiler??? - 10 years agoHelpfull: Yes(0) No(0)
- There should be backward slash for new line.
- 10 years agoHelpfull: Yes(0) No(0)
- output is nn nn nnn
nn
nn - 9 years agoHelpfull: Yes(0) No(0)
- nn nn nnnnn /n/n nn/n
- 9 years agoHelpfull: Yes(0) No(0)
- Output : nn nn nnnnn /n/n nn/n
ie. printf scharacters will be printed as it is....
- 9 years agoHelpfull: Yes(0) No(0)
- nn nn nnn
nn /n/n nn/n
since in the to print in next line we use n escape sequence but here /n is used.. - 9 years agoHelpfull: Yes(0) No(0)
- nn nn nnn
nn
nn - 8 years agoHelpfull: Yes(0) No(0)
- when we change void to int then it will print as it is in printf statements or it will provide declaration error
- 7 years agoHelpfull: Yes(0) No(0)
- output: nn nn nnnnn /n/n nn/n
n - this one will print new line
/n - not print a new line
hope you understood this! - 7 years agoHelpfull: Yes(0) No(0)
- nn nn nnnnn
nn - 6 years agoHelpfull: Yes(0) No(0)
- nn nn nnn
nn
nn - 6 years agoHelpfull: Yes(0) No(0)
- It shoud be compile time error for just a simple reason that #include doesn't contains the header name,for which the printf function will remain unknown and beyond compiler understanding
- 6 years agoHelpfull: Yes(0) No(0)
- nn nn nnn nn
nn - 2 years agoHelpfull: Yes(0) No(0)
- nn nn nnn nn /n/n nn/n
- 2 years agoHelpfull: Yes(0) No(0)
TCS Other Question