ex.

my first input is 1110 then my second input is 1101101.. i want add 3 zero to the 2nd input like 1101101000..

i am doing division. ans= second/first

help guys..

#include <iostream.h> #include <conio.h> #include <math.h> void binary(int); void binary1(int); int first, second, divisor, number; void main() { cout << "Enter an integer: "; cin >> first; cout << "Enter another integer: "; cin >> second; divisor = first / second; number = first % second; if (number < 0) cout << "That is not a positive integer.\n"; else { binary1(first); binary(number); cout << endl; } } void binary(int number) { int remainder; if(number <= 1) { cout << number; return; } remainder = number%2; binary(number >> 1); cout << remainder; } void binary1(int first) { int remainder1; if(first <= 1) { cout << first; return; } remainder1 = first%2; binary(first >> 1); cout << remainder1; }

*** MOD EDIT: Added code tags. Please ***

This post has been edited by **JackOfAllTrades**: 06 September 2009 - 05:27 AM