//**************************************
// Name: Simple calculator
// Description:simple calculator
//
**************************************/
#include<stdio.h>
main ()
{
printf ("[*] Simple Calculatrice v1.0\n");
int num1 , num2 ;
char mark ;
printf ("[*] First Number : ");
scanf ("%d",&num1);
printf ("[*] Enter Mark : ");
getchar () ;
scanf ("%c",&mark);
printf ("[*] Second Number : ");
scanf ("%d",&num2);
if ( mark == '+')
printf ("\n[*] Result = %d\n\n\n\n\n",num1+num2);
else if ( mark == '-')
printf ("\n[*] Result = %d\n\n\n\n\n",num1-num2);
else if ( mark == '*')
printf ("\n[*] Result = %d\n\n\n\n\n",num1*num2);
else if ( mark == '/')
printf ("\n[*] Result = %d\n\n\n\n\n",num1/num2);
else
printf ("\n[*] Error ! Invalid Mark\n\n\n\n\n");
}
// Name: Simple calculator
// Description:simple calculator
//
**************************************/
#include<stdio.h>
main ()
{
printf ("[*] Simple Calculatrice v1.0\n");
int num1 , num2 ;
char mark ;
printf ("[*] First Number : ");
scanf ("%d",&num1);
printf ("[*] Enter Mark : ");
getchar () ;
scanf ("%c",&mark);
printf ("[*] Second Number : ");
scanf ("%d",&num2);
if ( mark == '+')
printf ("\n[*] Result = %d\n\n\n\n\n",num1+num2);
else if ( mark == '-')
printf ("\n[*] Result = %d\n\n\n\n\n",num1-num2);
else if ( mark == '*')
printf ("\n[*] Result = %d\n\n\n\n\n",num1*num2);
else if ( mark == '/')
printf ("\n[*] Result = %d\n\n\n\n\n",num1/num2);
else
printf ("\n[*] Error ! Invalid Mark\n\n\n\n\n");
}
Comments
Post a Comment