Table of Contents
What is output of following code INT?
Q. | What is the output of the following code? int main() { double x=1.2; int sum=(int)x + 1; printf(“sum=\%d”,sum); return 0; } |
---|---|
B. | 2 |
C. | 2 |
D. | conversion from double to int is not possible |
Answer» b. 2 |
What will be the output of the following code int i 5 J 2 for?
Step 1: int i=5, j=2; Here variable i and j are declared as an integer type and initialized to 5 and 2 respectively. Step 2: fun(&i, &j); Here the function fun() is called with two parameters &i and &j (The & denotes call by reference….Exercise :: Functions – Find Output of Program.
A. | 0, 2, 1, 0, |
---|---|
D. | 0, 1, 2, 0, |
What will I and J equal after the code below is executed int i 5 int j i ++;?
What will i and j equal after the code below is executed? Explain your answer. int i = 5; int j = i++; After the above code executes, i will equal 6, but j will equal 5.
What is the output of print type type int ))?
Answer: So the output is type ‘type’.
What will the output of the following code be when executed?
Discussion Forum
Que. | What is the output when the following code is executed? >>>”Welcome to Python”.split() |
---|---|
b. | (“Welcome”, “to”, “Python”) |
c. | {“Welcome”, “to”, “Python”} |
d. | “Welcome”, “to”, “Python” |
Answer:[“Welcome”, “to”, “Python”]. |
What is the output of the following code int a 5 b10?
therefore the output will be 0.0510.
What is the output of code INT 30 40?
“30”+”40″ is actually acts as concatenation then the result will be “3040”.
What is the output of this program #include?
5. What is the output of this program? Explanation: The output is garbage value.
What is the output of this program has 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.
How does printf print the address of a function in C?
Explanation: Name of the function is actually a pointer variable to the function and prints the address of the function. Symbol table is implemented like this. Explanation: First printf prints “ew_c_questioy”. Second printf has in it so it goes back to start of the line and starts printing characters.
What is i j and K in printf?
Here, i, j and k are inside the enum and therefore, they are like constants. In other words, if want to use 10 anywhere in the program, we can use i instead. In the first printf, the value of k is being modified which is not allowed because it’s enum constant.
What is the difference between first second and third printf in C?
In the first printf, the value of k is being modified which is not allowed because it’s enum constant. In the second printf, left-shift operator is being applied on a float which is also not allowed. Similarly, in the third printf, modulus operator is being applied on float f and g which is also not allowed.
What is the for loop condition in printf statement?
For loop condition: ++i i.e. i = 1 + 1 = 2 i.e. loop condition is true. Hence printf statement will print 2 For loop condition: ++i i.e. i = 3 + 1 = 4 i.e. loop condition is true. Hence printf statement will print 4. Since is equal to for so if condition is also true.