Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
What is the output of the following code?
Home
C Plus Plus
What is the output of the following code?
0
votes
asked
May 23
in
C Plus Plus
by
rajeshsharma
What is the output of the following code?
int main() {
int x = 5;
printf(“%d”, x++);
return 0;
}
A) 5
B) 6
C) 4
D) None of the above
cout
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
May 23
by
rajeshsharma
Answer: A
Explanation: The value of x is first printed using the printf function and then incremented using the ++ operator. Therefore, the output is 5.
...