Write a Program to understand the use of floating point data type and arithmetic operation.
Write a Program to understand the use of floating point data type and arithmetic operation.
or
using Float Variable find the sum,sub,mul,div of two number
#include<stdio.h>
void main()
{
float a=50.25,b=25.50;
void main()
printf("Sum of two number is =%.2f\n",a+b);
printf("Sub of Two number is =%.2f\n",a-b);
printf("Multiply of Two number is =%.2f\n",a*b);
printf("Divide of two number is =%.2f\n",a/b);
getch();
}
or
#include<stdio.h>
void main()
{
float a=50.25,b=25.50,sum,sub,mul,div;
void main()
printf("Sum of two number is =%.2f\n",sum);
printf("Sub of Two number is =%.2f\n",sub);
printf("Multiply of Two number is =%.2f\n",mul);
printf("Divide of two number is =%.2f\n",div);
getch();
}
Recent Posts
See AllLinear search in an array using function sequential search in an array using function Linear search
Write a c program using Prefix increment/decrement concept.
Comments