Sunday, 3 February 2013

Input form User in C++

Today i'll teach you how to get input form user

cin>>    means input form user, now this input should be store in some where after that we print that            input or use some where else

if input is an integer type   we can define as      int
after that any variable where you save your input like i'll save in    a
  as         int a;
 ; means end of command
\n means next line

#include<iostream.h>
void main()
{

int a;
cout<<"enter your input";
cin>>a;
cout<<"your entered\n";
cout<<a;
}

No comments:

Post a Comment