CBSE Class 10 Computer Science C program for Addition Subtraction and Division using Else If ladder

#include<stdio.h>
#include<conio.h>
void main()
{
float n1,n2,result;
int choice;
clrscr();
printf("\n 1. Addition \n 2. Subtraction \n 3. Multiplication ");
printf("\n Enter your choice = ");
scanf("%d", &choice);
printf("\n Enter value of n1 = ");
scanf("%f", &n1);
printf("\n Enter value of n2 = ");
scanf("%f", &n2);
if(choice==1)
printf("\n Addition of %.2f and %.2f is %.2f", n1,n2,n1+n2);
else if(choice==2)
printf("\n Subtraction of %.2f and %.2f is %.2f",n1,n2,n1-n2);
else if(choice==3)
printf("\n Multiplication of %.2f and %.2f is %.2f", n1,n2,n1*n2);
else
printf("\n Invalid choice....");
getch();
}

Tags:

Click for more Computers Study Material
 CBSE Class 10 Computer Science C program for Addition Subtraction and Division using Else If ladder CBSE Class 10 Computer Science C program to convert Fahrenheit into Celsius CBSE Class 10 Computer Science C program of addition(function with return type and with arguments) CBSE Class 10 Computer Science C Program to display area and perimeter of square CBSE Class 10 Computer Science C program of array for theory only CBSE Class 10 Computer Science C program to find average of five subjects CBSE Class 10 Computer Science C program to illustrate use of function which return no value CBSE Class 10 Computer Science C program to display volume of cuboid CBSE Class 10 Computer Science C program to print series using for loop CBSE Class 10 Computer Science C program to find whether a given no is divisible by another number or not CBSE Class 10 Computer Science C program to illustrate use of function with argument and no return value CBSE Class 10 Computer Science C program to find volume of sphere CBSE Class 10 Computer Science C program to print series using while loop CBSE Class 10 Computer Science C Program To Display Your School Name Address CBSE Class 10 Computer Science C program to find student is pass or fail CBSE Class 10 Computer Science C program to illustrate use of function with argument and return value CBSE Class 10 Computer Science C program to find volume of cylinder CBSE Class 10 Computer Science C program to print series using do-while loop CBSE Class 10 Computer Science C Program to display first letter of your name CBSE Class 10 Computer Science C program to find person is eligible for voting or not CBSE Class 10 Computer Science C program to find simple interest CBSE Class 10 Computer Science C program to print odd numbers between given numbers CBSE Class 10 Computer Science C Program to display area and circumference of circle CBSE Class 10 Computer Science C program to find addition subtraction and multiplication using switch CBSE Class 10 Computer Science C program to convert meter into millimeter CBSE Class 10 Computer Science C program to print table of given number CBSE Class 10 Computer Science C Program to display area and perimeter of rectangle

Latest NCERT & CBSE News

Read the latest news and announcements from NCERT and CBSE below. Important updates relating to your studies which will help you to keep yourself updated with latest happenings in school level education. Keep yourself updated with all latest news and also read articles from teachers which will help you to improve your studies, increase motivation level and promote faster learning