Skip to main content

Posts

Showing posts from April, 2020

Q1. (2 ½ X 4 =10 Marks) Write the following functions that: a) Request the user for two integers and outputs them and their sum. b) Request the user for two integers and outputs their remainder after division. c) Request the user for two floats and outputs their product. d) Request the user for a word and prints it twice on the same row. Write a C (main) program to provide the above functions as options to the user using switch statement and performs the functions accordingly.

Q1. (2 ½ X 4 =10 Marks)  Write the following functions that:  a) Request the user for two integers and outputs them and their sum.  b) Request the user for two integers and outputs their remainder after division.  c) Request the user for two floats and outputs their product.  d) Request the user for a word and prints it twice on the same row.   Write a C (main) program to provide the above functions as options to the user using  switch statement and performs the functions accordingly. Explanation: #include <stdio.h> #include<conio.h> void main() { int a , b ; float c , d; int op, dividend , divisor, quotient , reminder; printf (" 1. Addition\n 2.Reminder\n 3.Multiplication\n 4.Same row\n"); printf("Enter the values of a and b : "); scanf("%d %d ", &a , &b); printf("Enter the values of c and d"); scanf("%f %f ", &c , &d "); printf("Enter your choice : "); scanf("%d ", &op); switch(...