Q:

C++ program to demonstrate example of cascading cout and cin

0

C++ program to demonstrate example of cascading cout and cin

In this program you will learn how to use cascading/ multiple cin and cout in c ++ programming language to print values and messages together.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

cascading cout and cin example in C++.

/*C++ program to demonstrate example of cascading cout & cin.*/
#include  <iostream>
using namespace std;
 
int main()
{
    int a,b;
 
    //without cascading cout
    cout << "Enter value of a and b : ";
 
    //cascading cin
    cin >>a >>b;
 
    //cascading cout
    cout<< "A : " << a << ", B : " << b << endl;
 
    return 0;
}

Output

    Enter value of a and b :10  20
    A : 10, B : 20

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Most popular and Searched C++ solved programs with Explanation and Output

Similar questions


need a help?


find thousands of online teachers now
C++ program to demonstrate use of Scope Resolution... >>
<< Read character array as string using cin in C++...