Monday, June 24, 2019

multification of the two numbers with out using " * " operator

#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a,b,i;
    int result=0;
    printf("enter two numbers to be multiplied\n");
    scanf("%d%d",&a,&b);
    for(i=1;i<=b;i++)
    {
        result = result+a;
         //printf("%d\n",result);
    }
    printf("%d * %d = %d \n",a,b,result);

    return 0;
}

No comments:

Post a Comment

python class topic video