addition, subtraction, multiplication and division of two numbers C programming || C programming examples

 addition, subtraction, multiplication and division of two numbers C programming  || C programming examples

#include <stdio.h>
 
int main()
{
   int first, add, subtract, multiply, second;
   float divide;
 
   printf("Enter two integers\n");
   scanf("%d%d", &first, &second);
 
   multiply = first * second;
   divide     = first / (float)second;   //typecasting
add = first + second; subtract = first - second;   printf("Sum = %d\n",add); printf("Difference = %d\n",subtract); printf("Multiplication = %d\n",multiply); printf("Division = %.2f\n",divide);   return 0; }
Share this Post Share to Facebook Share to Twitter Email This Pin This Share on Google Plus Share on Tumblr join on whatsapp

    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment