TODAY JAVA SCHOOL

In java school, programming, design, computer general knowledge, web application, software, web services, social media, digital marketing, oops, concept of programming language, oops feature, console media, graphics medium, first programming, c, c ++ , Java, PHP, SQL, MySQL, HTML, HTML_5, J_query, JavaScript, Bootstrap, Framework, images with logos, examples, shared and explained.

https://www.amazon.in/b?node=26373545031&linkCode=ll2&tag=1234567801cdb-21&linkId=3b9882431b00409b44141e0344b35a15&language=en_IN&ref_=as_li_ss_tl

Breaking

Tuesday 26 May 2020

C++ User Input | C++ User Input Programming Language | C++ User Input Programming Language In Hindi

C++ User Input


We  have learned that cout  is used to output (print) values. Now we will use cin to get user input.

cin  is a predefined variable that reads data from the keyboard with the extraction operator (>>).


image of C++ User Input

Fig: C++ User Input 


Program:

#include <iostream>

using namespace std;

int main() {

  int x;

  cout << "Type a number: "; // Type a number and press enter

  cin >> x; // Get user input from the keyboard

  cout << "Your number is: " << x;

  return 0;

}


Output:

Type a number:58

Your number is: 58


No comments:

Post a Comment