C program using Assignment Operator - 👑 सार्थक मुंड S3 🤴🏻

C program using Assignment Operator

 
Banner

Write a program (WAP) in C to read two numbers from keyboard(User Input) and perform addition, subtraction, multiplication and division using assignment operator.

#include <stdio.h>
int main()
{
 int num1, num2, sum, sub, mul;
 float div;

 printf("Enter two integers\n");
 scanf("%d%d", &num1, &num2);

 sum = num1 + num2;
 sub = num1 - num2;
 mul = num1 * num2;
 div = num1 / (float)num2;


 printf("Addition  is : %d\n", sum);
 printf("Subtraction is : %d\n", sub);
 printf("Multiplication is : %d\n", mul);
 printf("Division is : %.2f\n", div);

 return 0;
}

Try it Yourself ➠
output
Must Read :-
  1. Blogger Tutorial
  2. C Programs
  3. C++ Programs
  4. Java Programs
  5. Python Programs
  6. Programming Notes 
  7. Questions & Answers
  8. My Codes : HTML, CSS & JS
  9. All Subject Notes
Previous article
Next article

Leave Comments

Post a Comment

Articles Ads

Articles Ads 1

Articles Ads 2

Advertisement Ads