What's the output of this program? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 12

What's the output of this program?

#include<iostream> #include<stdio.h> using namespace std; int main() { int num1=5; int num2=3; int num3=2; num1=num2++; num2=--num3; cout<<num1<<num2<<num3; return 0; }

3rd Sep 2017, 1:46 PM
Angelin Blessy
8 Answers
+ 13
Error, because <iostream.h> should be <iostream>. If that is fixed, the output would be 311 You may refer to this thread if you need more information on prefix and postfix operators: https://www.sololearn.com/Discuss/407846/?ref=app
3rd Sep 2017, 1:51 PM
Hatsy Rei
Hatsy Rei - avatar
+ 12
Ya I've changed it
3rd Sep 2017, 2:25 PM
Angelin Blessy
+ 11
tqsm
3rd Sep 2017, 2:05 PM
Angelin Blessy
+ 4
Output wil be : 311
3rd Sep 2017, 3:33 PM
jc_pro___mmer
jc_pro___mmer - avatar
+ 2
311
9th Sep 2017, 11:45 AM
Kanvi Savani
Kanvi Savani - avatar
+ 2
output will be 311
18th Sep 2017, 8:05 AM
Kyawe Say Min
Kyawe Say Min - avatar
0
سلامو
29th Sep 2017, 11:47 AM
nazi
0
تشگر خوبم تو خوبی
29th Sep 2017, 11:48 AM
nazi