Sponsored Links


Results 1 to 2 of 2

Thread: if this is one statement then why we are using << again and again . what will happen

  1. #1
    sana.pari
    Guest

    Icon29 if this is one statement then why we are using << again and again . what will happen

    Sponsored Links1


    Dear Sir,

    you said before that cout<<"the digit is:"<<digit<<'\n';

    Sponsored Links

    i have confusion in this statement. if this is one statement then why we are using << again and again . what will happened if

    cout<<"the digit is:";

    cout<<digit;

    cout<<'\n';

    and what will happened if we shall use << one time like cout<<"the digit is :" digit '\n;

    and also in ICS i have studied c but that time we use blue screen for source code and black screen for run and both were there in the same window. i am confuse in these all like devc++, c++, c, c sharp. and what was that C++. and also we did not use there CMD and programms were running..

    please sir explain in detail. i am so worry because assingment date is very close.

    thank you very much

  2. #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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Only one of the following statement is correct.
    By vustudents in forum Public International Law LLB part 2
    Replies: 0
    Last Post: 09-07-2012, 04:09 AM
  2. Replies: 0
    Last Post: 07-18-2011, 01:37 AM
  3. loop statement in c++ 2011
    By Vuhelper in forum C++ Programing
    Replies: 0
    Last Post: 06-04-2011, 10:32 PM
  4. Difference b/w Income statement and P & L A/C
    By Vuhelper in forum Get Solution In 24 Hour
    Replies: 0
    Last Post: 04-23-2011, 05:06 AM
  5. FIN 621 Financial Statement Analysis May5, 2010
    By viki in forum MCQ's & Quiz Discussion
    Replies: 0
    Last Post: 05-05-2010, 06:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
-: Vuhelp Disclaimer :-
None of the files shown here are hosted or transmitted by this server. The links are provided solely by this site's users. The administrator's or staff of Vuhelp.net cannot be held responsible for what its users post, or any other actions of its users. You may not use this site to distribute or download any material when you do not have the legal rights to do so. It is your own responsibility to adhere to these terms. If you have any doubts about legality of content or you have any suspicions, feel free to contact us.
Online Education | JhelumSoft | Jobs