php hit counter

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
if this is one statement then why we are using << again and again . what will happen
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support
#2
Dear student!
cout<<"the digit is:"<<digit<<'/n'; is a single statement. Its meaning is to print "the digit is _____" and go to next line in output screen.
Blank is filled with the value present in digit mentioned after second extraction operator.
Let say 8 is stored in digit mentioned after second extraction operator. Then output would be
the digit is 8
As we have written \n. so after printing this line cursor would move to next line.
If we write
cout<<"the digit is:";
cout<<digit;
cout<<'/n';
These are three cout statements and it will print only "the digit is" .
It will terminate then because it will consider second line an other cout statement containing error because if it is cout statement then it must be written as cout<<"digit";
So correct way is to write
cout<<"the digit is:"<<digit<<'\n';

There are different development environments for programming. One is turbo C which you have used in ICS. Dev-C++ is an other programming environment for C++. which is used in this course. Both have its own advantages.
Reply


Messages In This Thread
if this is one statement then why we are using << again and again . what will happen - by Support - 04-24-2011, 06:05 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  loop statement in c++ 2011 Vuhelper 0 2,155 06-04-2011, 10:32 PM
Last Post: Vuhelper

Forum Jump:


Users browsing this thread: 1 Guest(s)
VU Help • House Banner VU Help Virtual University Students - Assignments, Solved Papers, GDB & Exam Help Student Help Forum • Collaborative • Free Support