Answer to Question #274294 in C++ for khan

Question #274294

1 Write a C program to print your name, date of birth, mobile numbers and university’s name on separate line.


2 Write a C program to perform addition, subtraction, multiplication and division of two integer


numbers, respectively 2 and 6 and show the result on the screen.


3 Write a C program to input a number from user and print multiplication table of the given


number using for loop.


4 Write a C program to input number from user and check number is palindrome or not using


while loop.


5 Write a C Program to calculate the Average of an array elements where the elements are


received as input.

1
Expert's answer
2021-12-02T00:37:59-0500
#include <stdio.h>
int main()  
{  
    int num1, num2;  
    int sum, sub, mult, mod;  
    float div;  
   
    printf("Input any two numbers separated by comma : ");  
    scanf("%d,%d", &num1, &num2);  
   
    sum = num1 + num2;  
    sub = num1 - num2;  
    mult = num1 * num2;  
    div = (float)num1 / num2;  
    mod = num1 % num2;  
     
    printf("The sum of the given numbers : %d\n", sum);  
    printf("The difference of the given numbers : %d\n", sub);  
    printf("The product of the given numbers : %d\n", mult);  
    printf("The quotient of the given numbers : %f\n", div);  
    printf("MODULUS = %d\n", mod);  
  
    return 0;   
} 

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment