Recent Posts

9-latest-250px-course

Write a C program for addition, subtraction, multiplication, division and modulus of two numbers

Write a C program for addition, subtraction, multiplication, division and modulus of two numbers

Program:-



#include <stdio.h>

#include <conio.h>

int main()

{
    int a,b;

    int sum, difference, product, modulo;

    float quotient;
     
    printf("Enter First Number: ");

    scanf("%d", &a);

    printf("Enter Second Number: ");

    scanf("%d", &b);

    sum = a + b;

    difference =a - b;

    product = a * b;

    quotient = a /b;

    modulo =a % b;
     
    printf("\nSum = %d", sum);

    printf("\nDifference  = %d", difference);

    printf("\nMultiplication = %d", product);

    printf("\nDivision = %f", quotient);

    printf("\nRemainder = %d", modulo);
     
    getch();

    return 0;

}

Output :-

Input:
Enter the three sides of the Triangle
a=?
b=?

Output:-
...
...
...
...

SHARE

Milan Tomic

Hi. I’m Designer of Blog Magic. I’m CEO/Founder of ThemeXpose. I’m Creative Art Director, Web Designer, UI/UX Designer, Interaction Designer, Industrial Designer, Web Developer, Business Enthusiast, StartUp Enthusiast, Speaker, Writer and Photographer. Inspired to make things looks better.

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment