Sunday, 7 April 2013

Division Of two Integers Without \ Operator Program in C++

#include<stdio.h>
#include<conio.h>
#include<iostream.h>
void main()
{
 int a,b,count=0;
 cout<<"division of two inter digits without '/' operator\n";
 cout<<"enter first no=";
 cin>>a;
 cout<<"enter second no=";
 cin>>b;
 a=a-b;
 while(a>=0)
 {
  count++;
  a=a-b;
 }
 cout<<"the result is="<<count;
 getch();
}

No comments:

Post a Comment