0
741views
Write a c program for multiplication using add shift method
1 Answer
1
47views


C Program for Multiplication using shift add method is : -


//importing library
#include<stdio.h>

int main(){
    int a, b, c;
    printf("Enter an integer: \n");
    scanf("%d", &a);
    printf("Enter an integer: \n");
    scanf("%d", &b);

    //multiply(a, b);

    c = 0; //product

    while(b != 0)
    {
        if(b & '\x01' == 1)
        {
            c = …

Create a free account to keep reading this post.

and 3 others joined a min ago.

Please log in to add an answer.