Monday 24 October 2016

Program : WAP to read one integer and one float type variable, calculate sum, difference, product and division of them and display the result in formatted manner.



#include<stdio.h>
#include<conio.h>

void main()
{
  int integer_number ;
  float real_number sum, diff , mul ,div;
  clrscr();

 printf("\nEnter one integer number:");
 scanf("%d",&integer_number);
 printf("\nEnter one float number:");
 scanf("%f",&real_number);

/****************Calculate sum of numbers**********/
sum=integer_number+real_number;
/**************Calculate difference******************************/
diff=integer_number -real_number;
/****************Calulate product *******************************/
mul=integer_number*real_number;
/***************Calculate division******************************/
div=integer_number/real_number;
/**************************************************************/
printf("\nThe Sum Of Number=\t%f",sum);
printf("\nThe Difference Of Number=\t%f",diff);
printf("\nThe Product Of Numbe=\t%f",mul);
printf("\nThe Division Of Number=\t%f",div);
getch();
}

Output: 
 

No comments:
Write comments