0% found this document useful (0 votes)
12 views1 page

IP 5 Output

The document contains a C program that prompts the user to input an arithmetic operation sign and two numbers. It uses a switch statement to perform the specified operation (addition, subtraction, multiplication, or division) and displays the result. If the user inputs an invalid operation sign, it prompts them to enter a valid one.

Uploaded by

hs005807
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

IP 5 Output

The document contains a C program that prompts the user to input an arithmetic operation sign and two numbers. It uses a switch statement to perform the specified operation (addition, subtraction, multiplication, or division) and displays the result. If the user inputs an invalid operation sign, it prompts them to enter a valid one.

Uploaded by

hs005807
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Programiz PRO

C Online Compiler

main.c Output

6 int c;
7 printf("Enter sign for your purposed arithmetic 0peration
(+,-,*,/):");
8 scanf(" %c",&s);
9 printf("\nenter 1st input:");
10 scanf("%f",&a);
11 printf("enter 2nd input:");
12 scanf("%f",&b);
13 switch(s){
14 case '+':printf("sum=%f",a+b);
15 break;
16 case '-':printf("sub=%f",a-b);
17 break;
18 case '*':printf("multi=%f",a*b);
19 break;
20 case '/':printf("div=%f",a/b);
21 break;
22 default:printf("invalid input!!\n PLEASE enter one of
(+,-,*,/) this sign");
23 }
24 return 0;
25 }
26

Run

You might also like