Subscribe to:
Post Comments (Atom)
CodeShikhi - The World for Programmers, প্রোগ্রামিং,Learn Programming,Learn Javascirpt | C | C++ | Python | OOP,Learn Programming in Bangla,Bangla Programming Tutorial,Leetcode Problem Solution,BEE Problem Solution,C Programming in Bangla,C in Bangla,Javascript tutorials,C Programming Bangla Tutorial, URI Online Judge Solution in C C++ Python,JavaScript Full Tutorials , OOP Tutorial in C++, Object Oriented Programming in C++,Learn OOP in C++,C Programming Exercise,C Programming Example with Code
#include<stdio.h> int main() { int a,b,i,multiplication=0; printf("Enter a,b\n"); scanf("%d%d",&a,&b); if(b<0) { a=a+b; b=a-b; a=a-b; } if(a>=0) { for(i=1;i<=a;i++) multiplication+=b; } if(a<0) { for(i=a;i<=-1;i++) multiplication-=b; } printf("Multiplication=%d\n",multiplication); }
Initializes :
We will first take two input numbers from user using scanf function then we calculate multiplication by using addition using following equations:
Finally print the result.
Previous Post:
0 Response to C Program for Multiplication by using Addition | C Programming Examples - 18
Post a Comment