Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
But "cin" lines are not producing the results 2011
#1
I can only have results with cout, but cin only works for the first line, and does not work for the upcoming lines, I am unable to execute my programms due to this problem. Anyhow if i delete the "cin" lines, then my programme is executed and shows all cout. But "cin" lines are not producing the results. I have checked this problem through different styles, but i am unable to have any solution. Kinly guide sir.
Reply
#2
Dear student!
cout is output stream & cin is input stream.
cout statement is for displaying output of program on screen. whatever you write in double quotes, it is printed on screen.
cout<<"Hello world";
Hello world will be printed on screen.
If you write
cout<<a; Then value of a would be printed on screen
Cin is not for displaying output, it takes input stream. Whatever you give input, it is stored in cin stream
Example:
cout<< enter your age";
cin>>age;

First line is asking for entering your input where input would be stored in age. I hope your ambiguity would have cleared now.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  array project code c++ 2011 Vuhelper 0 1,280 12-10-2011, 06:32 PM
Last Post: Vuhelper
  factorial in C++ code 2011 Vuhelper 0 956 12-10-2011, 06:31 PM
Last Post: Vuhelper
  stack during function call in C++ 2011 Vuhelper 0 2,033 11-05-2011, 05:05 PM
Last Post: Vuhelper
  What is the Thing Queue? in c++ 2011 Vuhelper 0 1,787 11-05-2011, 05:02 PM
Last Post: Vuhelper
  ASCII to char conversion code in C++ 2011 Vuhelper 0 1,727 11-05-2011, 05:01 PM
Last Post: Vuhelper
  How to write a summation in a sequence? C++ 2011-12 Vuhelper 2 1,360 09-19-2011, 04:53 AM
Last Post: Xpert
  GetPixel problem in c++ 2011-12 Vuhelper 0 2,511 09-18-2011, 07:12 PM
Last Post: Vuhelper
  C++ with loop code 2011-12 Vuhelper 0 982 09-18-2011, 07:09 PM
Last Post: Vuhelper
  how can i read the last letter of a input file? 2011 Vuhelper 0 1,836 09-12-2011, 10:24 PM
Last Post: Vuhelper
  Different syntax? in c++ 2011-12 Vuhelper 0 1,766 09-12-2011, 10:22 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)