Menu
×
×
Correct!

Exercise:

Fill in the missing parts to print the sum of two numbers (which is put in by the user):

int x, y; int sum; cout << "Type a number: "; cin >> x; cout << "Type another number: "; cin >> y; sum = x + y; cout << "Sum is: " << sum;

Not Correct

Click here to try again.

Correct!

Next ❯
int x, y;
int sum;
cout << "Type a number: ";
 >> ;
cout << "Type another number: ";
 >> ;
sum = x + y;
cout << "Sum is: " << ;

  
  
  




Go to w3schools.com
Reset Score
Close This Menu

 

C++ Syntax
C++ Variables
C++ User Input
C++ Data Types
C++ Operators
C++ Strings
C++ Math
C++ Booleans
C++ If...Else
C++ Switch
C++ Loops
C++ Arrays
C++ References
C++ Functions
C++ Classes/Objects





×

Reset the Score?

This will reset the score of ALL 58 exercises.

Are you sure you want to continue?



×

Congratulations!

You have finished all 58 C++ exercises.

Share your score on facebook: