What should be the output: int main(){ int a = 5; int b = 10; int c = a+b; printf("%i",c);} *
2 points
(A) 0
(B) 15
(C) Undefined i
(D) Any other Compiler Error
Answers
Answered by
0
Answer:
(b)
Explanation:
15.
I hope this will help you
Answered by
0
Answer:
A correct answer is option (B) 15.
Explanation:
In the program we have variables a and b declared as integer and having values assigned as 5 and 10 respectively. We also have a variable declared as c which will store the added value of a + b i.e. 5 + 10 = 15.
Later we are printing the value stored in variable c using printf("%i",c);
So the output of the program will print the value 15.
Here, %i is also used to print numeric values in 'c'. %d and %i both have the same purpose.
Similar questions