There are some steps you must be taken care :
1)In C we used "stdio.h" as a common header file but in C++ we used "iostream" header file .
2)After writing header file write using namespace std .
3)In C we write printf() and scanf() but in C++ we write cout<< and cin>> for output and taking value respectively.
THESE ARE THE SOME COMMON STEPS TO TAKE CARE WHILE WRITING THE C++ PROGRAM
EXAMPLE:
#include<iostream>
using namespace std ;
main()
{
cout<<"hello";
int a,b,c;
cout<<endl; //to change the line
cin>>a;
cin>>b;
c=a+b;
cout<<"sum is :"<<c;
}
1)In C we used "stdio.h" as a common header file but in C++ we used "iostream" header file .
2)After writing header file write using namespace std .
3)In C we write printf() and scanf() but in C++ we write cout<< and cin>> for output and taking value respectively.
THESE ARE THE SOME COMMON STEPS TO TAKE CARE WHILE WRITING THE C++ PROGRAM
EXAMPLE:
#include<iostream>
using namespace std ;
main()
{
cout<<"hello";
int a,b,c;
cout<<endl; //to change the line
cin>>a;
cin>>b;
c=a+b;
cout<<"sum is :"<<c;
}
No comments:
Post a Comment