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 AllWrite a c program using Prefix increment/decrement concept.
Write a C Program to find out the size of data types
Write a C program Integer arithmetic operations. write a c program to find sum,sub,mul, div and Reminder of Two Number.