hey im doing a school assignment and i would like some help please..
I basically need to write a progam that asks the user to input three non zero integers and determine and print if they could be the sides of a right angled triangle...
This is what i did
#include <stdio.h>
int main(void)
{
int Number1 = 0;
int Number2 = 0;
int hypotenuse = 0;
while (Number1 <= 0)
{
printf("Enter the first non-Zero Integer\n");
scanf_s("%d", &Number1);
}
while (Number2 <= 0)
{
printf("Enter the second non-Zero Integer\n");
scanf_s("%d", &Number2);
}
while (hypotenuse <= Number1, Number2)
{
printf("Enter the Hypotenuse\n");
scanf_s("%d", &hypotenuse);
}
}
I basically need to write a progam that asks the user to input three non zero integers and determine and print if they could be the sides of a right angled triangle...
This is what i did
#include <stdio.h>
int main(void)
{
int Number1 = 0;
int Number2 = 0;
int hypotenuse = 0;
while (Number1 <= 0)
{
printf("Enter the first non-Zero Integer\n");
scanf_s("%d", &Number1);
}
while (Number2 <= 0)
{
printf("Enter the second non-Zero Integer\n");
scanf_s("%d", &Number2);
}
while (hypotenuse <= Number1, Number2)
{
printf("Enter the Hypotenuse\n");
scanf_s("%d", &hypotenuse);
}
}