top of page
Writer's pictureYatendra Awana

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();

}


18 views0 comments

Recent Posts

See All

Comentários


bottom of page