Wednesday, June 3, 2020

Calculator program

#include <stdio.h>

int main()
{
    int a,b,c,d,e,f,g,h,i;
   
    printf("It is a program calculator\n");
    printf("Press 1 to add \n Press 2 to sub \n Press 3 to multi \n Press 4 to div\n  ");
    scanf("%d",&a);
    switch(a)
    {
        case 1:
     scanf("%d%d",&b,&c);
     printf("Enter the first number: ");
     printf("Enter the secound number:");
     printf("%d%d",b+c);
     break;
     case 2:
      scanf("%d%d",&d,&e);
       printf("Enter the first number: ");
     printf("Enter the secound number:");
     printf("%d%d",d-e);
     break;
     case 3:
      scanf("%d%d",&f,&g);
       printf("Enter the first number: ");
     printf("Enter the secound number:");
     printf("%d%d",f*g);
     break;
     case 5:
      scanf("%d%d",&h,&i);
       printf("Enter the first number: ");
     printf("Enter the secound number:");
     printf("%d%d",h/i);
     break;
   
    }
    return 0;
}

No comments:

Post a Comment

cisco Cybersecurity Essentials Quiz 8 answer in bold

Question  1 Correct Mark 2.00 out of 2.00 Flag question Question text A company has had several incidents involving users downloading unauth...