What is the output of printf \%d )?
1. When we write printf(“\%d”,x); this means compiler will print the value of x.
What will be output of following printf statement?
printf() prints the text as well as the value of the variable, constant etc. printf() returns an integer value that is the total number of printed characters including spaces, carriage return, line feed etc.
What does \%d mean in C code?
Format Specifiers in C
Specifier | Used For |
---|---|
\%Lf | long double |
\%n | prints nothing |
\%d | a decimal integer (assumes base 10) |
\%i | a decimal integer (detects the base automatically) |
What is the output of the statement printf D A++?
Answer: The output of this statement “print(“\%d”,(a++))” is The current value of a.
What will be the output of the pseudocode?
Common pseudocode notation OUTPUT – indicates that an output will appear on the screen. WHILE – a loop (iteration that has a condition at the beginning) FOR – a counting loop (iteration) REPEAT – UNTIL – a loop (iteration) that has a condition at the end.
What will be the output of the program public class Test?
public class Test{ public static void main(String [] args){ String s1 = args[1]; String s2 = args[2]; String s3 = args[3]; String s4 = args[4]; System. out. print(” args[2] = ” + s2); } }
What will be the output of the following program #include?
Solution(By Examveda Team) int i, j, m; The variable i, j, m are declared as an integer type. >> j = a[1]++; becomes j = 2++; Hence j = 2 and a[1] = 3. Hence the output of the program is 3, 2, 15.
What is an output statement?
An input/output statement or IO statement is a portion of a program that instructs a computer how to read and process information. It pertains to gather information from an input device, or sending information to an output device.
What will be the output of the following pseudo code for input 7?
T should be 28. It will loop till m>7 (since n=7) and in each iteration T adds m to itself, since T is 0 initially it is only summing up m after incrementing it by 1 in each iteration.So if you add 1+2+3….. +7 you get 28 and that is when the loop breaks since m is now equal to 8.
What does \%D mean in printf?
printf(\%d) is a syntax error. \% is the remainder operator. It requires two operands, and you’ve only given it one (assuming d is a valid expression). I’m sure that’s not what you meant, but it’s what you wrote.
What is the return value of printf function in C?
Function printf always returns the no. of bytes it has output. For example, the return value of printf(“geeks”) will be 5 because printf will output 5 characters here. In our case, the inner printf will be executed first but this printf doesn’t have argument for format specifier i.e. \%d.
What is the effective value of printf?
Suppose first element of array is x, then the argument inside printf becomes as follows. It’s effective value is 4. This program deals with macros, their side effects and operator precedence. Here prod is a macro which multiplies its two arguments a and b. Let us take a closer look.
What is the use of if condition in printf()?
It means this printf will print any arbitrary value. But notice that even for any arbitrary value, the no. of bytes output by inner printf would be non-zero. And those no. of bytes will work as argument to outer printf. The outer printf will print that many no. of bytes and return non-zero value always. So the condition for if is also true always.