Tuesday, 24 February 2015

Introduction Of Programming With C And C++

I am not telling about history of C/C++ language .Programming Is nothing But Just a line of Code in Computer Language ,as we Speak Multi language's same our system has it's own Language like C,C++ and Java .You have to know that our Computer Know's Only '0' (Zero) And '1' (One) ,one more thing i want to share with you in programming HELLO WORLD.. is a very famous program but i am not going to start with Hello World . For compilling your code we need a compilor their are many compilor like Borland ,Dev-C++ ,Turbo C, Code Blocks you can use anyone of them My favorite is Dev C++ cause it is fast and simple in use .But i think Codeblocks Is Better .I recommend Dev-C++ for beginner's And for Expert CodeBlocks 

For Downloading DEV-C++ Click Here

your First Step To Analysis The Following Code and Write And Modify By it's Own

C++ Program To Add Two Number

#include<iostream>                        //header file for input output
using namespace std;                      // for initilize input output statement
int main()                                        //starting a program
{
long a,b,c;                                       // long is a data type you can use float,double,and int
cout<<"enter the two nuber :"<<endl;
cin>>a>>b;                                    //enter value a nad then b
c=a+b;                                           //store sum in c
cout<<"sum is = "<<c<<endl;      //print sum
return 0;
}

C++ Program To Subtract Two Number

#include<iostream>                        //header file for input output
using namespace std;                      // for initilize input output statement
int main()                                        //starting a program
{
long a,b,c;                                       // long is a data type you can use float,double,and int
cout<<"enter the two nuber :"<<endl;
cin>>a>>b;                                    //enter value a nad then b
c=a-b;                                           //store sum in c
cout<<"subtraction is = "<<c<<endl;      //print sum
return 0;
}

C++ Program To Multiply Two Number

#include<iostream>                        //header file for input output
using namespace std;                      // for initilize input output statement
int main()                                        //starting a program
{
long a,b,c;                                       // long is a data type you can use float,double,and int
cout<<"enter the two nuber :"<<endl;
cin>>a>>b;                                    //enter value a nad then b
c=a*b;                                           //store sum in c
cout<<"multiple is = "<<c<<endl;      //print sum
return 0;
}

C++ Program To Divide Two Number

#include<iostream>                        //header file for input output
using namespace std;                      // for initilize input output statement
int main()                                        //starting a program
{
long a,b,c;                                       // long is a data type you can use float,double,and int
cout<<"enter the two nuber :"<<endl;
cin>>a>>b;                                    //enter value a nad then b
c=a/b;                                           //store sum in c
cout<<"devision is = "<<c<<endl;      //print sum
return 0;
}

C++ Program To Find Modulus (Reminder) Of Two Number

#include<iostream>                        //header file for input output
using namespace std;                      // for initilize input output statement
int main()                                        //starting a program
{
long a,b,c;                                       // long is a data type you can use float,double,and int
cout<<"enter the two nuber :"<<endl;
cin>>a>>b;                                    //enter value a nad then b
c=a%b;                                           //store sum in c
cout<<"modulus is = "<<c<<endl;      //print sum
return 0;
}

C++ Program To Find average Of Two Number

#include<iostream>                        //header file for input output
using namespace std;                      // for initilize input output statement
int main()                                        //starting a program
{
long a,b,c;                                       // long is a data type you can use float,double,and int
cout<<"enter the two nuber :"<<endl;
cin>>a>>b;                                    //enter value a nad then b
c=(a+b)/2;                                           //store sum in c
cout<<"avg is = "<<c<<endl;      //print sum
return 0;
}



No comments:
Write comments

Recommended Posts × +