Wednesday, May 20, 2020

Print user input in C++

  • Program :
#include <iostream>
using namespace std;

int main() {
  cout <<"\n----------------PRINT USER INPUT----------------\n";
  int x, y,sum;
  cout << "A value : ";
  cin >> x;
  cout << "B value : ";
  cin >> y;
  sum = x + y;
  cout << "Sum is: " << sum;
  return 0;
}


  • Output :


No comments:

Post a Comment

Function Overloading in C++

https://monitechvenkat1620.blogspot.com Program : #include <iostream> using namespace std; int c(int x, int y) {   return...