+ 7

I Need Help!!! I don't understand this at all???

Can someone help me? I don't understand this??? every time i put this code in, the output say "No Output." can someone tell me why? Here is the code: #include <iostream> using namespace std; int main() { int a = 30; int b = 15; int sum = a + b; return 0; }

28th May 2018, 10:26 PM
Artemis Newton
Artemis Newton - avatar
10 odpowiedzi
+ 22
Because you are not outputting anything. cout << sum
28th May 2018, 10:43 PM
Toni Isotalo
Toni Isotalo - avatar
+ 14
This is correct...check this code below.. #include<iostream> using namespace std; int main() { int a=30; int b=20; int sum=a+b; cout<<sum; return 0; } output: 50
29th May 2018, 12:36 AM
madhina
madhina - avatar
+ 4
Stormtrooper957 You really need to work on your foundamentals. int sum = a + b; cout<<sum;
28th May 2018, 11:35 PM
Jakub Stasiak
Jakub Stasiak - avatar
+ 4
Zeke Williams and madhina, and everyone else, thanks for the help :) its helped me a lot.
29th May 2018, 3:31 AM
Artemis Newton
Artemis Newton - avatar
+ 2
i tried that, but it didn't work. this is what i did (my code is below) is this what i have to do or can you show me? #include <iostream> using namespace std; int main() { int a = 30; int b = 15; cout << sum = a + b; return 0; }
28th May 2018, 11:31 PM
Artemis Newton
Artemis Newton - avatar
+ 2
You can even do it this way too: cout << a + b;
29th May 2018, 12:40 AM
Zeke Williams
Zeke Williams - avatar
+ 2
use cout << it is used for giving output
30th May 2018, 4:06 PM
Priyanshu Rai
Priyanshu Rai - avatar
+ 1
well i guess i just didn't care about fundamentals, Silly me. anyways Thanks Jakub Stasiak, it worked :) It doesn't show that in the C++ tutorial in SoloLearn. weird :/
28th May 2018, 11:52 PM
Artemis Newton
Artemis Newton - avatar
+ 1
int sum=a+b; count<<sum;
29th May 2018, 5:39 AM
Ayush Kumar Sharma
Ayush Kumar Sharma - avatar
+ 1
whats up guys! how do i get the ball rolling here
29th May 2018, 7:30 AM
#’zDntLyImNotDA1
#’zDntLyImNotDA1 - avatar