SlideShare a Scribd company logo
1 of 5
Switch

#include<stdio.h>

#include<conio.h>

#include<stdlib.h>

main ()

{

    printf("Nisarat Kramsri     No.16        M.6/1nn");

Nisarat Kramsri         No.16        M.6/1

       int choice;

       float num1,num2;                  num1,num2

       printf("Please select choicen");

       printf("1.Program additionn");

       printf("2.Program substractionn");

       printf("3.Exit programn");

       scanf("%d",&choice);
switch(choice)                switch

   case 3:exit(3);

   printf("Enter number1: ");

   scanf("%f",&num1);

   printf("Enter number2: ");

   scanf("%f",&num2);

   switch(choice)               switch

   {

   case 1:

printf("%.2f+%.2f=%.2fn",num1,num2,num1+num2);break;




   case 2: printf("%.2f-%.2f=%.2fn",num1,num2,num1-
num2);break;



   }

   getch();
}
Flowchart




              nisarat kramsri
            No.16 M.




                   Choice




    yes
              Choice=3


                       no




Choice=1                        Choice=2



Num1+num2                       Num1-num2

More Related Content

Viewers also liked

āļ„āļģāļŠāļąāđˆāļ‡ For
āļ„āļģāļŠāļąāđˆāļ‡ Forāļ„āļģāļŠāļąāđˆāļ‡ For
āļ„āļģāļŠāļąāđˆāļ‡ Forkramsri
 
Sample template to report internet dns's performance
Sample template to report internet dns's performanceSample template to report internet dns's performance
Sample template to report internet dns's performanceMustafa Golam
 
āļ‡āļēāļ™āļ™āļģāđ€āļŠāļ™āļ­1
āļ‡āļēāļ™āļ™āļģāđ€āļŠāļ™āļ­1āļ‡āļēāļ™āļ™āļģāđ€āļŠāļ™āļ­1
āļ‡āļēāļ™āļ™āļģāđ€āļŠāļ™āļ­1kramsri
 
Grand strategi agar koperasi1
Grand strategi agar koperasi1Grand strategi agar koperasi1
Grand strategi agar koperasi1Irna Indriani
 
Ekonomi koperasi
Ekonomi koperasiEkonomi koperasi
Ekonomi koperasiIrna Indriani
 
accreditation 2
 accreditation 2 accreditation 2
accreditation 2Tota Essam
 
Linear day 17
Linear day 17Linear day 17
Linear day 17cirilah
 
āļ„āļģāļŠāļąāđˆāļ‡ Do while
āļ„āļģāļŠāļąāđˆāļ‡ Do whileāļ„āļģāļŠāļąāđˆāļ‡ Do while
āļ„āļģāļŠāļąāđˆāļ‡ Do whilekramsri
 
āļ„āļģāļŠāļąāđˆāļ‡ Switch.2
āļ„āļģāļŠāļąāđˆāļ‡ Switch.2āļ„āļģāļŠāļąāđˆāļ‡ Switch.2
āļ„āļģāļŠāļąāđˆāļ‡ Switch.2kramsri
 
āļ„āļģāļŠāļąāđˆāļ‡ Do while
āļ„āļģāļŠāļąāđˆāļ‡ Do whileāļ„āļģāļŠāļąāđˆāļ‡ Do while
āļ„āļģāļŠāļąāđˆāļ‡ Do whilekramsri
 
GPRS/EDGE Basics / knowledge sharing
GPRS/EDGE Basics /  knowledge sharingGPRS/EDGE Basics /  knowledge sharing
GPRS/EDGE Basics / knowledge sharingMustafa Golam
 
Aula3 sistemas lineares - parte1
Aula3   sistemas lineares - parte1Aula3   sistemas lineares - parte1
Aula3 sistemas lineares - parte1rafamaco
 
Treliça inclinada-pronto11
 Treliça inclinada-pronto11 Treliça inclinada-pronto11
Treliça inclinada-pronto11Fer Nando
 

Viewers also liked (14)

āļ„āļģāļŠāļąāđˆāļ‡ For
āļ„āļģāļŠāļąāđˆāļ‡ Forāļ„āļģāļŠāļąāđˆāļ‡ For
āļ„āļģāļŠāļąāđˆāļ‡ For
 
Sample template to report internet dns's performance
Sample template to report internet dns's performanceSample template to report internet dns's performance
Sample template to report internet dns's performance
 
āļ‡āļēāļ™āļ™āļģāđ€āļŠāļ™āļ­1
āļ‡āļēāļ™āļ™āļģāđ€āļŠāļ™āļ­1āļ‡āļēāļ™āļ™āļģāđ€āļŠāļ™āļ­1
āļ‡āļēāļ™āļ™āļģāđ€āļŠāļ™āļ­1
 
Grand strategi agar koperasi1
Grand strategi agar koperasi1Grand strategi agar koperasi1
Grand strategi agar koperasi1
 
Ekonomi koperasi
Ekonomi koperasiEkonomi koperasi
Ekonomi koperasi
 
accreditation 2
 accreditation 2 accreditation 2
accreditation 2
 
Curiosites 11
Curiosites 11Curiosites 11
Curiosites 11
 
Linear day 17
Linear day 17Linear day 17
Linear day 17
 
āļ„āļģāļŠāļąāđˆāļ‡ Do while
āļ„āļģāļŠāļąāđˆāļ‡ Do whileāļ„āļģāļŠāļąāđˆāļ‡ Do while
āļ„āļģāļŠāļąāđˆāļ‡ Do while
 
āļ„āļģāļŠāļąāđˆāļ‡ Switch.2
āļ„āļģāļŠāļąāđˆāļ‡ Switch.2āļ„āļģāļŠāļąāđˆāļ‡ Switch.2
āļ„āļģāļŠāļąāđˆāļ‡ Switch.2
 
āļ„āļģāļŠāļąāđˆāļ‡ Do while
āļ„āļģāļŠāļąāđˆāļ‡ Do whileāļ„āļģāļŠāļąāđˆāļ‡ Do while
āļ„āļģāļŠāļąāđˆāļ‡ Do while
 
GPRS/EDGE Basics / knowledge sharing
GPRS/EDGE Basics /  knowledge sharingGPRS/EDGE Basics /  knowledge sharing
GPRS/EDGE Basics / knowledge sharing
 
Aula3 sistemas lineares - parte1
Aula3   sistemas lineares - parte1Aula3   sistemas lineares - parte1
Aula3 sistemas lineares - parte1
 
Treliça inclinada-pronto11
 Treliça inclinada-pronto11 Treliça inclinada-pronto11
Treliça inclinada-pronto11
 

Similar to C program switch case calculator

āļ•āļąāļ§āļ­āļĒāđˆāļēāļ‡āļāļēāļĢāđ€āļ‚āļĩāļĒāļ™āđ‚āļ›āļĢāđāļāļĢāļĄ āđ‚āļ”āļĒāđƒāļŠāđ‰āļŸāļąāļ‡āļāđŒāļŠāļąāļ™
āļ•āļąāļ§āļ­āļĒāđˆāļēāļ‡āļāļēāļĢāđ€āļ‚āļĩāļĒāļ™āđ‚āļ›āļĢāđāļāļĢāļĄ āđ‚āļ”āļĒāđƒāļŠāđ‰āļŸāļąāļ‡āļāđŒāļŠāļąāļ™āļ•āļąāļ§āļ­āļĒāđˆāļēāļ‡āļāļēāļĢāđ€āļ‚āļĩāļĒāļ™āđ‚āļ›āļĢāđāļāļĢāļĄ āđ‚āļ”āļĒāđƒāļŠāđ‰āļŸāļąāļ‡āļāđŒāļŠāļąāļ™
āļ•āļąāļ§āļ­āļĒāđˆāļēāļ‡āļāļēāļĢāđ€āļ‚āļĩāļĒāļ™āđ‚āļ›āļĢāđāļāļĢāļĄ āđ‚āļ”āļĒāđƒāļŠāđ‰āļŸāļąāļ‡āļāđŒāļŠāļąāļ™Warawut
 
Numerical Methods in C
Numerical Methods in CNumerical Methods in C
Numerical Methods in CAmbili Baby
 
āļ āļēāļĐāļēāļ‹āļĩ
āļ āļēāļĐāļēāļ‹āļĩāļ āļēāļĐāļēāļ‹āļĩ
āļ āļēāļĐāļēāļ‹āļĩkramsri
 
CP Handout#6
CP Handout#6CP Handout#6
CP Handout#6trupti1976
 
C lab manaual
C lab manaualC lab manaual
C lab manaualmanoj11manu
 
SIMPLE C PROGRAMS - SARASWATHI RAMALINGAM
SIMPLE C PROGRAMS - SARASWATHI RAMALINGAMSIMPLE C PROGRAMS - SARASWATHI RAMALINGAM
SIMPLE C PROGRAMS - SARASWATHI RAMALINGAMSaraswathiRamalingam
 
Chapter 5 Balagurusamy Programming ANSI in c
Chapter 5 Balagurusamy Programming ANSI  in cChapter 5 Balagurusamy Programming ANSI  in c
Chapter 5 Balagurusamy Programming ANSI in cBUBT
 
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...Computer programming subject notes. Quick easy notes for C Programming.Cheat ...
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...DR B.Surendiran .
 
1. Translation program#includestdio.h#includeconio.h#incl.pdf
1. Translation program#includestdio.h#includeconio.h#incl.pdf1. Translation program#includestdio.h#includeconio.h#incl.pdf
1. Translation program#includestdio.h#includeconio.h#incl.pdfsutharbharat59
 
SaraPIC
SaraPICSaraPIC
SaraPICSara Sahu
 
C programs
C programsC programs
C programsMinu S
 
Practical File of C Language
Practical File of C LanguagePractical File of C Language
Practical File of C LanguageRAJWANT KAUR
 
Incorporate the SOR method in the multigridTest-m and apply the multig.pdf
Incorporate the SOR method in the multigridTest-m and apply the multig.pdfIncorporate the SOR method in the multigridTest-m and apply the multig.pdf
Incorporate the SOR method in the multigridTest-m and apply the multig.pdfaartechindia
 

Similar to C program switch case calculator (20)

āļ•āļąāļ§āļ­āļĒāđˆāļēāļ‡āļāļēāļĢāđ€āļ‚āļĩāļĒāļ™āđ‚āļ›āļĢāđāļāļĢāļĄ āđ‚āļ”āļĒāđƒāļŠāđ‰āļŸāļąāļ‡āļāđŒāļŠāļąāļ™
āļ•āļąāļ§āļ­āļĒāđˆāļēāļ‡āļāļēāļĢāđ€āļ‚āļĩāļĒāļ™āđ‚āļ›āļĢāđāļāļĢāļĄ āđ‚āļ”āļĒāđƒāļŠāđ‰āļŸāļąāļ‡āļāđŒāļŠāļąāļ™āļ•āļąāļ§āļ­āļĒāđˆāļēāļ‡āļāļēāļĢāđ€āļ‚āļĩāļĒāļ™āđ‚āļ›āļĢāđāļāļĢāļĄ āđ‚āļ”āļĒāđƒāļŠāđ‰āļŸāļąāļ‡āļāđŒāļŠāļąāļ™
āļ•āļąāļ§āļ­āļĒāđˆāļēāļ‡āļāļēāļĢāđ€āļ‚āļĩāļĒāļ™āđ‚āļ›āļĢāđāļāļĢāļĄ āđ‚āļ”āļĒāđƒāļŠāđ‰āļŸāļąāļ‡āļāđŒāļŠāļąāļ™
 
C Programming Example
C Programming Example C Programming Example
C Programming Example
 
Numerical Methods in C
Numerical Methods in CNumerical Methods in C
Numerical Methods in C
 
C programs
C programsC programs
C programs
 
āļ āļēāļĐāļēāļ‹āļĩ
āļ āļēāļĐāļēāļ‹āļĩāļ āļēāļĐāļēāļ‹āļĩ
āļ āļēāļĐāļēāļ‹āļĩ
 
āļšāļ—āļ—āļĩāđˆ 3
āļšāļ—āļ—āļĩāđˆ 3āļšāļ—āļ—āļĩāđˆ 3
āļšāļ—āļ—āļĩāđˆ 3
 
CP Handout#6
CP Handout#6CP Handout#6
CP Handout#6
 
Progr3
Progr3Progr3
Progr3
 
C lab manaual
C lab manaualC lab manaual
C lab manaual
 
SIMPLE C PROGRAMS - SARASWATHI RAMALINGAM
SIMPLE C PROGRAMS - SARASWATHI RAMALINGAMSIMPLE C PROGRAMS - SARASWATHI RAMALINGAM
SIMPLE C PROGRAMS - SARASWATHI RAMALINGAM
 
Chapter 5 Balagurusamy Programming ANSI in c
Chapter 5 Balagurusamy Programming ANSI  in cChapter 5 Balagurusamy Programming ANSI  in c
Chapter 5 Balagurusamy Programming ANSI in c
 
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...Computer programming subject notes. Quick easy notes for C Programming.Cheat ...
Computer programming subject notes. Quick easy notes for C Programming.Cheat ...
 
1. Translation program#includestdio.h#includeconio.h#incl.pdf
1. Translation program#includestdio.h#includeconio.h#incl.pdf1. Translation program#includestdio.h#includeconio.h#incl.pdf
1. Translation program#includestdio.h#includeconio.h#incl.pdf
 
SaraPIC
SaraPICSaraPIC
SaraPIC
 
C programs
C programsC programs
C programs
 
cpract.docx
cpract.docxcpract.docx
cpract.docx
 
Practical File of C Language
Practical File of C LanguagePractical File of C Language
Practical File of C Language
 
Incorporate the SOR method in the multigridTest-m and apply the multig.pdf
Incorporate the SOR method in the multigridTest-m and apply the multig.pdfIncorporate the SOR method in the multigridTest-m and apply the multig.pdf
Incorporate the SOR method in the multigridTest-m and apply the multig.pdf
 
7 functions
7  functions7  functions
7 functions
 
C Programming Exam problems & Solution by sazzad hossain
C Programming Exam problems & Solution by sazzad hossainC Programming Exam problems & Solution by sazzad hossain
C Programming Exam problems & Solution by sazzad hossain
 

More from kramsri

āļ‚ āļ­āļŠāļ­āļšāļ„āļ­āļĄ 5 āļ‚ āļ­āļŠāđˆāļ‡
āļ‚ āļ­āļŠāļ­āļšāļ„āļ­āļĄ 5 āļ‚ āļ­āļŠāđˆāļ‡āļ‚ āļ­āļŠāļ­āļšāļ„āļ­āļĄ 5 āļ‚ āļ­āļŠāđˆāļ‡
āļ‚ āļ­āļŠāļ­āļšāļ„āļ­āļĄ 5 āļ‚ āļ­āļŠāđˆāļ‡kramsri
 
āļ‚ āļ­āļŠāļ­āļšāļ„āļ­āļĄ #6
āļ‚ āļ­āļŠāļ­āļšāļ„āļ­āļĄ #6āļ‚ āļ­āļŠāļ­āļšāļ„āļ­āļĄ #6
āļ‚ āļ­āļŠāļ­āļšāļ„āļ­āļĄ #6kramsri
 
āļ„āļģāļŠāļąāđˆāļ‡ Switch
āļ„āļģāļŠāļąāđˆāļ‡ Switchāļ„āļģāļŠāļąāđˆāļ‡ Switch
āļ„āļģāļŠāļąāđˆāļ‡ Switchkramsri
 
āļ›āļĢāļ°āđ€āļĄ āļ™āļĢāļēāļĒāļ‡āļēāļ™ āļāļĨ _āļĄāļ—__ 2 āļ„āļģāļŠ__āļ‡āļ„āļ§āļšāļ„_āļĄāļ‚__āļ™āļž__āļ™āļāļēāļ™āļ āļēāļĐāļēāļ‹_ (1)
āļ›āļĢāļ°āđ€āļĄ āļ™āļĢāļēāļĒāļ‡āļēāļ™ āļāļĨ _āļĄāļ—__ 2 āļ„āļģāļŠ__āļ‡āļ„āļ§āļšāļ„_āļĄāļ‚__āļ™āļž__āļ™āļāļēāļ™āļ āļēāļĐāļēāļ‹_ (1)āļ›āļĢāļ°āđ€āļĄ āļ™āļĢāļēāļĒāļ‡āļēāļ™ āļāļĨ _āļĄāļ—__ 2 āļ„āļģāļŠ__āļ‡āļ„āļ§āļšāļ„_āļĄāļ‚__āļ™āļž__āļ™āļāļēāļ™āļ āļēāļĐāļēāļ‹_ (1)
āļ›āļĢāļ°āđ€āļĄ āļ™āļĢāļēāļĒāļ‡āļēāļ™ āļāļĨ _āļĄāļ—__ 2 āļ„āļģāļŠ__āļ‡āļ„āļ§āļšāļ„_āļĄāļ‚__āļ™āļž__āļ™āļāļēāļ™āļ āļēāļĐāļēāļ‹_ (1)kramsri
 
āļ›āļĢāļ°āđ€āļĄ āļ™āļĢāļēāļĒāļ‡āļēāļ™ āļāļĨ _āļĄāļ—__ 2 āļ„āļģāļŠ__āļ‡āļ„āļ§āļšāļ„_āļĄāļ‚__āļ™āļž__āļ™āļāļēāļ™āļ āļēāļĐāļēāļ‹_
āļ›āļĢāļ°āđ€āļĄ āļ™āļĢāļēāļĒāļ‡āļēāļ™ āļāļĨ _āļĄāļ—__ 2 āļ„āļģāļŠ__āļ‡āļ„āļ§āļšāļ„_āļĄāļ‚__āļ™āļž__āļ™āļāļēāļ™āļ āļēāļĐāļēāļ‹_āļ›āļĢāļ°āđ€āļĄ āļ™āļĢāļēāļĒāļ‡āļēāļ™ āļāļĨ _āļĄāļ—__ 2 āļ„āļģāļŠ__āļ‡āļ„āļ§āļšāļ„_āļĄāļ‚__āļ™āļž__āļ™āļāļēāļ™āļ āļēāļĐāļēāļ‹_
āļ›āļĢāļ°āđ€āļĄ āļ™āļĢāļēāļĒāļ‡āļēāļ™ āļāļĨ _āļĄāļ—__ 2 āļ„āļģāļŠ__āļ‡āļ„āļ§āļšāļ„_āļĄāļ‚__āļ™āļž__āļ™āļāļēāļ™āļ āļēāļĐāļēāļ‹_kramsri
 
āļ„āļ§āļēāļĄāļ„āļīāļ”āđ€āļŦāđ‡āļ™āđ€āļžāļ·āđˆāļ­āļ™(āđāļšāļšāļ›āļĢāļ°āđ€āļĄāļīāļ™)
āļ„āļ§āļēāļĄāļ„āļīāļ”āđ€āļŦāđ‡āļ™āđ€āļžāļ·āđˆāļ­āļ™(āđāļšāļšāļ›āļĢāļ°āđ€āļĄāļīāļ™)āļ„āļ§āļēāļĄāļ„āļīāļ”āđ€āļŦāđ‡āļ™āđ€āļžāļ·āđˆāļ­āļ™(āđāļšāļšāļ›āļĢāļ°āđ€āļĄāļīāļ™)
āļ„āļ§āļēāļĄāļ„āļīāļ”āđ€āļŦāđ‡āļ™āđ€āļžāļ·āđˆāļ­āļ™(āđāļšāļšāļ›āļĢāļ°āđ€āļĄāļīāļ™)kramsri
 
āļ›āļĢāļ°āļāļ§āļ”āļ āļēāļžāļ–āđˆāļēāļĒ
āļ›āļĢāļ°āļāļ§āļ”āļ āļēāļžāļ–āđˆāļēāļĒāļ›āļĢāļ°āļāļ§āļ”āļ āļēāļžāļ–āđˆāļēāļĒ
āļ›āļĢāļ°āļāļ§āļ”āļ āļēāļžāļ–āđˆāļēāļĒkramsri
 

More from kramsri (7)

āļ‚ āļ­āļŠāļ­āļšāļ„āļ­āļĄ 5 āļ‚ āļ­āļŠāđˆāļ‡
āļ‚ āļ­āļŠāļ­āļšāļ„āļ­āļĄ 5 āļ‚ āļ­āļŠāđˆāļ‡āļ‚ āļ­āļŠāļ­āļšāļ„āļ­āļĄ 5 āļ‚ āļ­āļŠāđˆāļ‡
āļ‚ āļ­āļŠāļ­āļšāļ„āļ­āļĄ 5 āļ‚ āļ­āļŠāđˆāļ‡
 
āļ‚ āļ­āļŠāļ­āļšāļ„āļ­āļĄ #6
āļ‚ āļ­āļŠāļ­āļšāļ„āļ­āļĄ #6āļ‚ āļ­āļŠāļ­āļšāļ„āļ­āļĄ #6
āļ‚ āļ­āļŠāļ­āļšāļ„āļ­āļĄ #6
 
āļ„āļģāļŠāļąāđˆāļ‡ Switch
āļ„āļģāļŠāļąāđˆāļ‡ Switchāļ„āļģāļŠāļąāđˆāļ‡ Switch
āļ„āļģāļŠāļąāđˆāļ‡ Switch
 
āļ›āļĢāļ°āđ€āļĄ āļ™āļĢāļēāļĒāļ‡āļēāļ™ āļāļĨ _āļĄāļ—__ 2 āļ„āļģāļŠ__āļ‡āļ„āļ§āļšāļ„_āļĄāļ‚__āļ™āļž__āļ™āļāļēāļ™āļ āļēāļĐāļēāļ‹_ (1)
āļ›āļĢāļ°āđ€āļĄ āļ™āļĢāļēāļĒāļ‡āļēāļ™ āļāļĨ _āļĄāļ—__ 2 āļ„āļģāļŠ__āļ‡āļ„āļ§āļšāļ„_āļĄāļ‚__āļ™āļž__āļ™āļāļēāļ™āļ āļēāļĐāļēāļ‹_ (1)āļ›āļĢāļ°āđ€āļĄ āļ™āļĢāļēāļĒāļ‡āļēāļ™ āļāļĨ _āļĄāļ—__ 2 āļ„āļģāļŠ__āļ‡āļ„āļ§āļšāļ„_āļĄāļ‚__āļ™āļž__āļ™āļāļēāļ™āļ āļēāļĐāļēāļ‹_ (1)
āļ›āļĢāļ°āđ€āļĄ āļ™āļĢāļēāļĒāļ‡āļēāļ™ āļāļĨ _āļĄāļ—__ 2 āļ„āļģāļŠ__āļ‡āļ„āļ§āļšāļ„_āļĄāļ‚__āļ™āļž__āļ™āļāļēāļ™āļ āļēāļĐāļēāļ‹_ (1)
 
āļ›āļĢāļ°āđ€āļĄ āļ™āļĢāļēāļĒāļ‡āļēāļ™ āļāļĨ _āļĄāļ—__ 2 āļ„āļģāļŠ__āļ‡āļ„āļ§āļšāļ„_āļĄāļ‚__āļ™āļž__āļ™āļāļēāļ™āļ āļēāļĐāļēāļ‹_
āļ›āļĢāļ°āđ€āļĄ āļ™āļĢāļēāļĒāļ‡āļēāļ™ āļāļĨ _āļĄāļ—__ 2 āļ„āļģāļŠ__āļ‡āļ„āļ§āļšāļ„_āļĄāļ‚__āļ™āļž__āļ™āļāļēāļ™āļ āļēāļĐāļēāļ‹_āļ›āļĢāļ°āđ€āļĄ āļ™āļĢāļēāļĒāļ‡āļēāļ™ āļāļĨ _āļĄāļ—__ 2 āļ„āļģāļŠ__āļ‡āļ„āļ§āļšāļ„_āļĄāļ‚__āļ™āļž__āļ™āļāļēāļ™āļ āļēāļĐāļēāļ‹_
āļ›āļĢāļ°āđ€āļĄ āļ™āļĢāļēāļĒāļ‡āļēāļ™ āļāļĨ _āļĄāļ—__ 2 āļ„āļģāļŠ__āļ‡āļ„āļ§āļšāļ„_āļĄāļ‚__āļ™āļž__āļ™āļāļēāļ™āļ āļēāļĐāļēāļ‹_
 
āļ„āļ§āļēāļĄāļ„āļīāļ”āđ€āļŦāđ‡āļ™āđ€āļžāļ·āđˆāļ­āļ™(āđāļšāļšāļ›āļĢāļ°āđ€āļĄāļīāļ™)
āļ„āļ§āļēāļĄāļ„āļīāļ”āđ€āļŦāđ‡āļ™āđ€āļžāļ·āđˆāļ­āļ™(āđāļšāļšāļ›āļĢāļ°āđ€āļĄāļīāļ™)āļ„āļ§āļēāļĄāļ„āļīāļ”āđ€āļŦāđ‡āļ™āđ€āļžāļ·āđˆāļ­āļ™(āđāļšāļšāļ›āļĢāļ°āđ€āļĄāļīāļ™)
āļ„āļ§āļēāļĄāļ„āļīāļ”āđ€āļŦāđ‡āļ™āđ€āļžāļ·āđˆāļ­āļ™(āđāļšāļšāļ›āļĢāļ°āđ€āļĄāļīāļ™)
 
āļ›āļĢāļ°āļāļ§āļ”āļ āļēāļžāļ–āđˆāļēāļĒ
āļ›āļĢāļ°āļāļ§āļ”āļ āļēāļžāļ–āđˆāļēāļĒāļ›āļĢāļ°āļāļ§āļ”āļ āļēāļžāļ–āđˆāļēāļĒ
āļ›āļĢāļ°āļāļ§āļ”āļ āļēāļžāļ–āđˆāļēāļĒ
 

C program switch case calculator

  • 1. Switch #include<stdio.h> #include<conio.h> #include<stdlib.h> main () { printf("Nisarat Kramsri No.16 M.6/1nn"); Nisarat Kramsri No.16 M.6/1 int choice; float num1,num2; num1,num2 printf("Please select choicen"); printf("1.Program additionn"); printf("2.Program substractionn"); printf("3.Exit programn"); scanf("%d",&choice);
  • 2. switch(choice) switch case 3:exit(3); printf("Enter number1: "); scanf("%f",&num1); printf("Enter number2: "); scanf("%f",&num2); switch(choice) switch { case 1: printf("%.2f+%.2f=%.2fn",num1,num2,num1+num2);break; case 2: printf("%.2f-%.2f=%.2fn",num1,num2,num1- num2);break; } getch();
  • 3. }
  • 4.
  • 5. Flowchart nisarat kramsri No.16 M. Choice yes Choice=3 no Choice=1 Choice=2 Num1+num2 Num1-num2