Sunday, 7 September 2014

Multiply two positive numbers without using * operator

# Multiply two positive numbers without using   *  operator /


CODE

#include<stdio.h>
#include<conio.h>
int main(){
    int a,b,i;
    int result=0;
    printf("Enter two number to be multiply : ");
    scanf("%d%d",&a,&b);
    for(i=1;i<=b;i++)
        result=result+a;
    printf("%d*%d=%d\n",a,b,result);
}


RESULT

 Enter two number to be multiply : 54

5*4=20

 


0 comments:

Post a Comment