Breaking News

C++ Program To Divide Two Numbers

This program will show u that how to divide two numbers in c++

There are many methods to divide two numbers u can implement your logic also

Algorithm :

1.Start

2.Declare any to variables and get the input for them from the user

3.Declare another variable to store the result

4.After performing division operation store the result into the new or 3rd variable created

5.Print The result

6.That's it two numbers are divided.....!!!!!!

Program (Method  1):

#include<iostream.h>
#include<conio.h>
void main()
{
            int a,b,c;
            cout<<"Enter The Value Of A";
            cin>>a;
            cout<<"Enter The Value Of B";
            cin>>b;
            c=a/b;
            cout<<"Addition ="<<c;
            getch();
}

Program (Method 2):

#include<iostream.h>
#include<conio.h>
void main()
{
            int a,b;
            cout<<"Enter The Value Of A";
            cin>>a;
            cout<<"Enter The Value Of B";
            cin>>b;
            cout<<"Addition ="<<a/b;
            getch();
}

No comments