Question:

Problem in c++ of making class. plz help me?

by  |  earlier

0 LIKES UnLike

when i compile and run the program it run but when it display name and age all are in same stanza.

i want that display the name and age in different stanza.

plz help me

 Tags:

   Report

3 ANSWERS


  1. You mean to make a gap in between the lines? I assume C++ is C# and in that class this is an example:

    console.writeline("alsdkfj");

    console.readline(); // Makes a new line

    console.writeline("asdlk");

    etc.

    sorry if this is not what you are looking for


  2. add \n or endl in cout statements


  3. you have to add endl or "\n" at the end of the line to break a sentence

    example :

    cout << " Name is :"+ name+"\n";

    or else

    cout <<" Age is :"+Age<<endl;

    where as in "C"

    printf ("Name is : %s\n"+name);

    hopes this will help you ...

Question Stats

Latest activity: earlier.
This question has 3 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions