answersLogoWhite

0

In c++, to manipulate output & input you must use cin and cout.


I will write a sample program to show you:


#include //possibly iostream.h


using namespace std; //This is what lets you use cin & cout


int main()

{

cout<<"Hi"; //always remember to use insertion operators (<< & >>) and quotes ("") AND ALWAYS TERMINATE YOUR LINE WITH SEMICOLON (;)

}

Hope that helped


User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

How you can use two input in a single statement in c plus plus?

cout&lt;&lt;"______": cin &gt;&gt;__&gt;&gt;__; [example cout&lt;&lt;"enter no."; cin&gt;&gt;a&gt;&gt;b; ]


How do you write a program in C plus plus to find volumn of a cuboid?

#include&lt;iostream.h&gt; void main() { int l,b,h,v; cout&lt;&lt;"Enter length "; cin&gt;&gt;l; cout&lt;&lt;"Enter breadth "; cin&gt;&gt;b; cout&lt;&lt;"Enter Height "; cin&gt;&gt;h; v=l*b*h; cout&lt;&lt;"Volume is "&lt;&lt;v; }


Write a program to read two integers and display them using C plus plus programming?

#include&lt;iostream&gt; using namespace std; int main(int argc,char *argv[]){ int num1,num2; cout &lt;&lt; "Enter the first number" &lt;&lt; endl; cin &gt;&gt; num1; cout &lt;&lt; "Enter the second number" &lt;&lt; endl; cin &gt;&gt; num2; cout &lt;&lt; "(" &lt;&lt; num1 &lt;&lt; " " &lt;&lt; num2 &lt;&lt; " )\n"; return 0; }


1 Write a C plus plus program to read two integers and display them Use cin and cout statements?

#include &lt;iostream&gt; using namespace std; int main() { int x,y; cout&lt;&lt;"please, enter the 1st value : "; cin&gt;&gt;x; cout&lt;&lt;"please, enter the 2nd value : "; cin&gt;&gt;y; cout&lt;&lt;endl; cout&lt;&lt;"the first value is : "&lt;&lt;x&lt;&lt;endl; cout&lt;&lt;"the second value is : "&lt;&lt;y&lt;&lt;endl; return 0; }


Write a program for addition in c plus plus?

#include#includemain(){clrscr();coutb;cout


Why cin and cout are not consider as keywords?

cin and cout are iostream objects, not keywords.


How do you use cin in C plus plus?

The class cin is an iostream class that abstracts stdin, allowing you to read from the stdin (console input) file. For instance: int age; cout &lt;&lt; "How old are you? "; cin &gt;&gt; age; cout &lt;&lt; "You said you were " &lt;&lt; age " years of age " &lt;&lt; endl;


How do you make a input and output basic statement in C plus plus?

The most basic input/output operations can be performed with std::cin for input and std::cout for output. For example: #include&lt;iostream&gt; int main (void) { int n; std::cout &lt;&lt; "Enter a number: "; std::cin &gt;&gt; n; std::cout &lt;&lt; "The value " &lt;&lt; n &lt;&lt; " was entered!\n"; }


How do you write a c plus plus program to read two floating point numbers and find the sum and average?

#include&lt;iostream&gt; int main() { double a, b; std::cout &lt;&lt; "Enter a number: "; std::cin &gt;&gt; a; std::cout &lt;&lt; "Enter another number: "; std::cin &gt;&gt; b; std::cout &lt;&lt; "Sum: " &lt;&lt; a + b &lt;&lt; std::endl; std::cout &lt;&lt; "Average: " &lt;&lt; (a + b) / 2 &lt;&lt; std::endl; }


Write a program to enter a character and it will tell the character etered?

{char a;...cout > a;cout


Program in c plus plus that accepts 10 input integer and to get the Greatest common divisor?

#include&lt;iostream&gt; using namespace std; int gcf(int a, int b) { int t; while(b!=0) { t = b; b = a%b; a = t; } return a; } int main() { int a,b,c,d,e,f,g,h,i,j,k; cout&lt;&lt;"Enter 1st numbers: "; cin&gt;&gt;a; cout&lt;&lt;"Enter 2nd numbers: "; cin&gt;&gt;b; cout&lt;&lt;"Enter 3rd numbers: "; cin&gt;&gt;c; cout&lt;&lt;"Enter 4th numbers: "; cin&gt;&gt;d; cout&lt;&lt;"Enter 5th numbers: "; cin&gt;&gt;e; cout&lt;&lt;"Enter 6th numbers: "; cin&gt;&gt;f; cout&lt;&lt;"Enter 7th numbers: "; cin&gt;&gt;g; cout&lt;&lt;"Enter 8th numbers: "; cin&gt;&gt;h; cout&lt;&lt;"Enter 9th numbers: "; cin&gt;&gt;i; cout&lt;&lt;"Enter 10th numbers: "; cin&gt;&gt;j; k=gcf((((((((gcf(a,b),c),d),e),f),g),h),i),j); cout&lt;&lt;"The GCD of the 10 numbers is: "&lt;&lt;k&lt;&lt;endl; system("pause"); return 0; }


How we can write a program in C plus plus that takes a number from the user and prints whether it is even or odd?

#include &lt;iostream&gt; using namespace std; int main() { int x; cout &lt;&lt; "Enter a number: "; cin &gt;&gt; x; if(x % 2 == 0) { cout &lt;&lt; x &lt;&lt; " is even" &lt;&lt; endl; } else { cout &lt;&lt; x &lt;&lt; " is odd" &lt;&lt; endl; } char wait; cin &gt;&gt; wait; return 0; }