Answered Questions

  • Accept two numbers from the user...

    ...and multiply these two numbers without using the multiplication operator! using any loop!

    Delbin

    • Jul 22nd, 2012

    Code
    1. #include<stdio.h>
    2. #include<stdlib.h>
    3. main()
    4. {
    5.         int a,b,result=0;
    6.         scanf("%d%d",&a,&b);
    7.         while(a)
    8.         {
    9.                 result=result+b;
    10.                 a--;
    11.         }
    12.         printf("%d
    13. ",result);
    14. }