Home » » Mathematical operations in C++ - Example Program

Mathematical operations in C++ - Example Program

Mathematical operations in C++ - Example Program
 
Write a program to perform the arithmetic operations by using arithmetic operators. Also print the result on the screen.  
See below the resultant output and programming code for the above program.


Program code is given below:

#include<iostream.h>
#include<conio.h>
main(){
     int a, b;
clrscr();
a=78;
b=27;

cout<<"-----------------------------------"<<endl;
cout<<"Addition      : "<<a+b<<endl;
cout<<"Subtration    : "<<a-b<<endl;
cout<<"Multiplcation : "<<a*b<<endl;
cout<<"Division      : "<<a/b<<endl;
cout<<"Modulus       : "<<a%b<<endl;
cout<<"----------------------------------"<<endl;
}

Thanks for visiting Mathematical operations in C++ - Example Program
Download more from: CS Adventures

0 comments:

Post a Comment

LIKE US

Popular Posts

My FANS around the WORLD

Flag Counter