C program calculater

#include <stdio.h>
int dclare;
int num1;
int num2;
void option()
{
printf("for ' + ' type 1\n for ' - ' type 2 \n for ' * ' type 3\n");
scanf("%d", &dclare);
void option2()
{
switch (dclare)
{
case 1:
printf("=%d", num1 + num2);
break;

case 2:
printf("=%d", num1 - num2);
break;
case 3:
printf("=%d", num1 * num2);
break;
default:
printf("enter again");
break;
}
}
int main()
{
printf("\nenter the first number\n>>");
scanf("%d", &num1);
printf("enter the second number\n>>");
scanf("%d", &num2);
option();
option2();

main();
}


Comments

  1. This is your first stage of your program I don't know about this keep it up u will get success

    ReplyDelete

Post a Comment

Popular posts from this blog

Snake game.c

Type declaration

Array with function