Now lets take a look at other things you can do by using the last program by just changing one line .
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,sum,difference,product,quotient ; // Variables for storing that input and output
printf("\n Enter the first number: ")
scanf("%d",&a);
printf("\n Enter the second number: ");
scanf("%d",&b);
sum=a+b; // Calculate sum
difference=a-b; // Calculate difference
product=a*b; // Calculate product
quotient=a/b; // Calculate quotient
printf("\n Sum Is %d \n Differrence is %d \n Product is %d \n Quotient is %d\n ",sum,difference,product,quotient);
getch(); // Wait till any key is pressed
}
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,sum,difference,product,quotient ; // Variables for storing that input and output
printf("\n Enter the first number: ")
scanf("%d",&a);
printf("\n Enter the second number: ");
scanf("%d",&b);
sum=a+b; // Calculate sum
difference=a-b; // Calculate difference
product=a*b; // Calculate product
quotient=a/b; // Calculate quotient
printf("\n Sum Is %d \n Differrence is %d \n Product is %d \n Quotient is %d\n ",sum,difference,product,quotient);
getch(); // Wait till any key is pressed
}
No comments:
Post a Comment