Displays the Sum and Difference of the Squares of Two Numbers

#include <stdio.h>
int main(void)
{
float num1,num2;
float sum,difference;
clrscr();
printf(“This program displays the sum and difference of the squares of two numbers.\n”);
printf(“Enter first number:\n”);
scanf(“%f”,&num1);
printf(“Enter second number:\n”);
scanf(“%f”,&num2);
printf(“Your numbers are %.2f and %.2f.\n”,num1,num2);
sum = (num1*num1)+(num2*num2);
difference = (num1*num1)-(num2*num2);
printf(“The sum is %.2f and the difference is %.2f.\n”,sum,difference);
getch();
return 0;
}

#include <stdio.h>
int main(void){float num1,num2;float sum,difference;clrscr();
printf(“This program displays the sum and difference of the squares of two numbers.\n”);printf(“Enter first number:\n”);scanf(“%f”,&num1);printf(“Enter second number:\n”);scanf(“%f”,&num2);printf(“Your numbers are %.2f and %.2f.\n”,num1,num2);
sum = (num1*num1)+(num2*num2);difference = (num1*num1)-(num2*num2);
printf(“The sum is %.2f and the difference is %.2f.\n”,sum,difference);
getch();return 0;}

2 Comments

  1. Sir,
    First of all I’d like to thank you for your effort. This is the first time I am visiting your blog and I must say that I am totally impressed. The articles that you’ve published so far were invaluable. Especially the students of computer science can highly benefit from your works. I have an entire section on C language in my blog http://technolocus.blogspot.com/2010/05/c-language.html. I will be obliged if you visit a few pages and give me your feedback. I would also like to use a few links to your blog from my pages, if that’s okay with you. Please visit my blog and let me know where you want me to give these links. Thanks once again for doing such a great work.
    God bless you.

    Reply

Leave a comment