Arithmetic Operations in C

Arithmetic Operations using c program.

--------------------------------------------------------------------

#include<stdio.h> 

#include<conio.h>

int main()

{

int a,b,ch;

printf(" 1.Addition\n 2. Subtraction\n 3. Multiplication\n 4.Division\n");

int op; printf("Enter the values of a & b: "); scanf("%d %d",&a,&b); 

printf("Enter your Choice: "); 

scanf("%d", &ch);

switch(ch)

{

case 1 :printf("Sum of %d and %d is: %d", a,b,a+b);break;

case 2:printf("Difference of %d and %d is: %d",a,b,a-b); break;

case 3:printf("Multiplication of %d and %d is : %d" ,a,b,a*b);break;

case 4 : printf("Division of Two Numbers is %d ",a/b);break;

default:printf(" Enter Your Correct Choice."); break;

return 0;

}

-------------------------------------❤️---------------------------------

إرسال تعليق (0)
أحدث أقدم

{getMailchimp} $title={Stay Informed} $text={Subscribe to our mailing list to get the new updates.}