C++ Decision-making Statements
Predict Output Questions For Beginners
(if, if-else, nested if, else if ladder, switch, etc.)
This blog assists in mastering C and C++ programming skills from basics to advanced levels.
Predict Output Questions For Beginners
(if, if-else, nested if, else if ladder, switch, etc.)
Followings are popular C++ Function Practicals that every beginners must know.
return_type: Data type of the value returned by the function (e.g., int, float, void)
function_name: Name of the function (should be meaningful)
parameter_list: Input values passed to the function (optional)
function body: Contains the logic of the function
return statement: Sends the result back to the calling function
Write a C++ program that reads two integers from the user, calculates their difference, and checks whether the result is positive, negative, or zero.
#include <iostream>
A) <!-- comment -->
B) ## comment
C) // comment
D) /* comment */
Answer: D
A) Java
B) Python
C) C
D) Pascal
Answer: C
A) .c
B) .cpp
C) .java
D) .py
Answer: B
A) start()
B) run()
C) main()
D) program()
Answer: C
A) stdlib.h
B) conio.h
C) iostream
D) string
Answer: C
A) system
B) std
C) main
D) global
Answer: B
A) >>
B) <<
C) ::
D) ==
Answer: B
A) int
B) char
C) float
D) bool
Answer: C
A) :
B) .
C) ;
D) ,
Answer: C
A) int 1num;
B) int num1;
C) int num-1;
D) int num 1;
Answer: B
A) =
B) ==
C) ++
D) //
Answer: B
A) for
B) while
C) do-while
D) nested loop
Answer: C
A) fixed
B) const
C) constant
D) define
Answer: B
A) <!-- comment -->
B) ## comment
C) // comment
D) ** comment
Answer: C
A) &&
B) &
C) %
D) ^
Answer: A