Write a program to calculate the value of (a2-b2) in c

Write a program to calculate the value of the given expression: (a2-b2). Take the values of a, b as input from the console.

#include<stdio.h>
#include<conio.h>
void main() {
	float a,b,total;
	printf("Enter the value of a\n");
	scanf("%d", &a);

	printf("Enter the value of b\n");
	scanf("%d", &b);

	total = (a+b) * (a-b);
	printf("%d", total);
}

kabeer

Added  Jul 23, 05:40 pm

Article tags

×
Google login
SignUp with Email
X