SlideShare a Scribd company logo
SWITCH
//program that ask user arithmetic operator by switch case.
#include<stdio.h>
#include<conio.h>
int main()
{
int n,a,b,c;
float e,f,g;
clrscr();
printf("Enter choice number");
scanf("%d",&n);
switch(n)
{
case 1:
printf("Enter two number for addition:");
scanf("%d%d",&a,&b);
c=a+b;
printf("n Sum=%d",c);
break;
case 2:
printf (" Enter two number for subtraction:");
scanf("%d%d",&a,&b);
c=a-b;
printf("n Sub=%d",c);
break;
case 3:
printf (" Enter two number for multiplication ");
scanf("%d%d",&a,&b);
c=a*b;
printf("n Multiplication is=%d",c);
break;
case 4:
printf ("Enter two number for division");
scanf("%f%f",&f,&g);
e=f/g;
printf("n Division is=%2f",e);
break;
default:
printf(" this is a invalid number");
break;
}
getch();
}
//created by: ANKIT DUBEY
Page 1

More Related Content

DOCX
program in c
PPTX
Najmul
PDF
Bcsl 033 data and file structures lab s1-1
DOC
C program to check leap year
PDF
Progr3
PPTX
C Programming Example
DOCX
Calculator in cpp
program in c
Najmul
Bcsl 033 data and file structures lab s1-1
C program to check leap year
Progr3
C Programming Example
Calculator in cpp

What's hot (20)

PDF
Bcsl 033 data and file structures lab s2-2
PDF
Bcsl 033 data and file structures lab s3-3
PDF
Bcsl 033 data and file structures lab s3-1
PDF
C Programming Example
PDF
Bcsl 033 data and file structures lab s2-3
PDF
Bcsl 033 data and file structures lab s4-2
PDF
Bcsl 033 data and file structures lab s5-3
PDF
Bcsl 033 data and file structures lab s2-1
DOCX
some basic C programs with outputs
PDF
Implement a queue using two stacks.
PDF
Bcsl 033 data and file structures lab s3-2
PPTX
Computer programing w
DOCX
Practical write a c program to reverse a given number
DOCX
One dimensional operation of Array in C- language
PDF
Bcsl 033 data and file structures lab s5-2
PDF
Program to reflecta triangle
Bcsl 033 data and file structures lab s2-2
Bcsl 033 data and file structures lab s3-3
Bcsl 033 data and file structures lab s3-1
C Programming Example
Bcsl 033 data and file structures lab s2-3
Bcsl 033 data and file structures lab s4-2
Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s2-1
some basic C programs with outputs
Implement a queue using two stacks.
Bcsl 033 data and file structures lab s3-2
Computer programing w
Practical write a c program to reverse a given number
One dimensional operation of Array in C- language
Bcsl 033 data and file structures lab s5-2
Program to reflecta triangle
Ad

More from Ankit Dubey (20)

PDF
Unit 1 android and it's tools quiz {mad cwipedia}
PDF
Scheduling
PDF
Chapter 4
PDF
Chapter 3
PDF
Chapter 2
PDF
Chapter 1
PDF
Chapter 5
PDF
Ch5 cpu-scheduling
PDF
Ch4 threads
PDF
Ch3 processes
PPT
Ch2 system structure
PPT
Ch1 introduction-to-os
PDF
Android i
PDF
Mongodb mock test_ii
PDF
Android mock test_iii
PDF
Android mock test_ii
PDF
Ajp notes-chapter-06
PDF
Ajp notes-chapter-05
PDF
Ajp notes-chapter-04
PDF
Ajp notes-chapter-03
Unit 1 android and it's tools quiz {mad cwipedia}
Scheduling
Chapter 4
Chapter 3
Chapter 2
Chapter 1
Chapter 5
Ch5 cpu-scheduling
Ch4 threads
Ch3 processes
Ch2 system structure
Ch1 introduction-to-os
Android i
Mongodb mock test_ii
Android mock test_iii
Android mock test_ii
Ajp notes-chapter-06
Ajp notes-chapter-05
Ajp notes-chapter-04
Ajp notes-chapter-03
Ad

Recently uploaded (20)

PDF
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
PDF
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
PDF
Categorization of Factors Affecting Classification Algorithms Selection
PPTX
Artificial Intelligence
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PDF
Design Guidelines and solutions for Plastics parts
PPTX
Current and future trends in Computer Vision.pptx
PPTX
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
PPTX
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
PPTX
Information Storage and Retrieval Techniques Unit III
PDF
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PPT
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
COURSE DESCRIPTOR OF SURVEYING R24 SYLLABUS
PDF
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
PPTX
Management Information system : MIS-e-Business Systems.pptx
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
PPTX
Feature types and data preprocessing steps
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
Categorization of Factors Affecting Classification Algorithms Selection
Artificial Intelligence
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
Design Guidelines and solutions for Plastics parts
Current and future trends in Computer Vision.pptx
CURRICULAM DESIGN engineering FOR CSE 2025.pptx
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
Information Storage and Retrieval Techniques Unit III
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
Automation-in-Manufacturing-Chapter-Introduction.pdf
COURSE DESCRIPTOR OF SURVEYING R24 SYLLABUS
EXPLORING LEARNING ENGAGEMENT FACTORS INFLUENCING BEHAVIORAL, COGNITIVE, AND ...
Management Information system : MIS-e-Business Systems.pptx
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
Feature types and data preprocessing steps

Switch

  • 1. SWITCH //program that ask user arithmetic operator by switch case. #include<stdio.h> #include<conio.h> int main() { int n,a,b,c; float e,f,g; clrscr(); printf("Enter choice number"); scanf("%d",&n); switch(n) { case 1: printf("Enter two number for addition:"); scanf("%d%d",&a,&b); c=a+b; printf("n Sum=%d",c); break; case 2: printf (" Enter two number for subtraction:"); scanf("%d%d",&a,&b); c=a-b; printf("n Sub=%d",c); break; case 3: printf (" Enter two number for multiplication "); scanf("%d%d",&a,&b); c=a*b; printf("n Multiplication is=%d",c); break; case 4: printf ("Enter two number for division"); scanf("%f%f",&f,&g); e=f/g; printf("n Division is=%2f",e); break; default: printf(" this is a invalid number"); break; } getch(); } //created by: ANKIT DUBEY Page 1