Results 1 to 4 of 4

Thread: What is the difference between cin and cout in C++

  1. #1
    Join Date
    Jan 2011
    Posts
    33

    What is the difference between cin and cout in C++

    Hey Guys, I wanted to know about the difference between cin and cout. I am not able to understand which input operator is and which the output operator is. Is there any operator symbol used in cin and cout? If anyone having knowledge or information then please let me know as soon as possible. If anyone having any related information then please let me know.

  2. #2
    Join Date
    May 2009
    Posts
    539

    Re: What is the difference between cin and cout in C++

    C++ performs the input and output operation by mean of cin and cout. These are the two objects of the predefined classes which are in header file iostream.h. So to perform the input output operation one has to include the iostream h header file in the program. cin uses the input operator << where as cout uses the output operator >>. Cin is an object which receives input from the keyboard and stores the input given by the user in the variable defined by user. Whereas cout it retrieves the value of the variable and display it on screen.

  3. #3
    Join Date
    May 2009
    Posts
    527

    Re: What is the difference between cin and cout in C++

    Cin and Cout are the two streams.
    The general syntax for cin is as.

    cin>> var1>>var2….;

    The cin statement accepts the input from the user and stores it in a variable which is on the right hand side.

    The general syntax for cout is as.
    cout<< var1<<var2….;

    The cout statement retrieves data from the variable which is on the right hand side and displays it on the screen.

  4. #4
    Join Date
    May 2009
    Posts
    637

    Re: What is the difference between cin and cout in C++

    You must know that when you have to print any statement in C++ then you have to use cout operator in C++. Cin is used as input operator in C++ where it will read the variable and then it stores the input which is been sent by the user from the keyboard. You can assume cin as input given by the user where as the cout is the input given by the user to display it in output.

Similar Threads

  1. How can I print any number or character using cout in C++
    By UseME in forum Software Development
    Replies: 5
    Last Post: 26-02-2010, 10:17 PM
  2. Difference between jsp and asp.net
    By Crespin in forum Software Development
    Replies: 3
    Last Post: 24-11-2009, 06:57 AM
  3. What is the difference between JSP and PHP?
    By Volodymyra in forum Software Development
    Replies: 3
    Last Post: 20-04-2009, 10:23 PM
  4. What is the Difference between Blu-ray and HD-DVD?
    By Maryna in forum Hardware Peripherals
    Replies: 3
    Last Post: 06-01-2009, 01:43 PM
  5. Difference between VB and VB.net
    By Braze in forum Software Development
    Replies: 3
    Last Post: 05-01-2009, 10:19 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,944,319.02099 seconds with 17 queries