Document (3) HW

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

#include <iostream.

h>

#include <conio.h>

void multiplay(float num1,int num2);

void main()

int num1=0,num2=0;

cout<<"Please enter the first value : ";

cin>>num1;

cout<<"Please enter the second value: ";

cin>>num2;

cout<<"Multiplicant \t\t Multiplier\n";

multiplay(num1,num2);

cout<<"\n";

cout<<"Result of num1 * num2 = "<<num1*num2;

getch();

//********************************************************

void multiplay(float num1,int num2)

int k=0;

while (num1>= 1)

k = (int) num1;

if (num2 >0)

cout<<k<<" ";

if(k%2==0)

cout<<"(\"Even\")";

cout<<"\t\t\t "<<num2<<"\n";

else break;

num2 = num2+num2;

num1 = num1/2;

You might also like