Input & Output
- What will be the output of the following C code?
#include <stdio.h>
int main(int argc, char** argv)
{
char *str = "Interveiw";
int n = 3;
printf("%10.*s", n, str);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Int(note:6 spaces after Int)
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
int n = 25, m = 13;
printf("%d %d %d", n, m);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
25 13 Garbage value
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
int m = 31, n = 13, p = 30;
printf("%d %d ", m, n, p);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: E
31 13
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
char *str = "Interview";
int n = 30;
printf("%*s", n, str);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Interview(note: spaces to the left of Interview)
- What is the difference between %e and %g?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
%e always formats in the format [-]m.dddddd or [-]m.dddddE[+|-]xx where no.of ds are optional and output formatting depends on the argument