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();
}
Share this post
  • Share to Facebook
  • Share to Twitter
  • Share to Google+
  • Share to Stumble Upon
  • Share to Evernote
  • Share to Blogger
  • Share to Email
  • Share to Yahoo Messenger
  • More...

0 comments:

Post a Comment