.. www.engineerscur.blogspot.com: C language program to make small calculator program with switch case

C language program to make small calculator program with switch case

//calculator with switch case

#include<stdio.h>
#include<conio.h>
void main()
{
            int i,j,k,l,c;
            clrscr();
            cprintf("enter the value of a:");
            scanf("%d",&i);
            cprintf("enter the value of b:");
            scanf("%d",&j);
            printf(“enter  any no for add. press 1,for sub.2  ,for mul.3 ,for div. 4”);
            scanf(“%d”,&c);
            switch(c)
{
            case 0:
                        printf(“add is:-%d”,i+j);
            break;
            case 1:
                        printf(“sub is:-%d”,i-j);
            break;
            case 2:
                        printf(“mul is:-%d”,i*j);
            break;
            case 3:
                        printf(“div. is:-%d”,i/j);
            break;

            default:
            printf(“error !!!”);
}

getch();
}