Saturday, 22 August 2015

Write a C Program to Find Summation , Subtraction And Multiplication of Float Numbers

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

int main()
{
 int x,y;   // define 2 integer variable x & y
 float a,b;    // define 2 real variable x & y
 clrscr();    //  clears the output window

 printf("\n Arithmetic operation on integer:-");

printf("\n\n Enter 1st integer number : ");
 scanf("%d",&x);  // input first integer number
           
 printf(" Enter 2nd integer number : ");
 scanf("%d",&y);   // input second integer number
           
 printf("\n\n Addition of two integer numbers is    : %d",x+y);
 printf("\n Multiplication of two integer numbers is : %d",x*y);
 printf("\n Division of two integers numbers is     : %d",x/y);
           
 printf("\n\n Arithmetic operation on float:-");
 printf("\n\n Enter 1st float number : ");
 scanf("%f",&a);   // input first real number
           
 printf(" Enter 2nd float number : ");
 scanf("%f",&b);    // input second real number
           
 printf("\n\n Addition of two float number is :%.2f",a+b);
 printf("\n Multiplication of two float number is :%.2f",a*b);
 printf("\n Division of two float number is:%.2f",a/b);

 getch();

return 0;

}

No comments:

Post a Comment