Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int x,y,z;
- while(1){
- printf("Enter the lengths of three sides of a triangle:\t");
- scanf("%d %d %d",&x,&y,&z);
- if(x>0&&y>0&&z>0){
- if((x==y) && (y==z)){
- printf("The triangle is equilateral\t");
- }
- else if((x==z) || (y==z) || (x==y)){
- printf("The triangle is isoseles\t");
- }
- else{
- printf("The triangle is scalene\t");
- }
- break;
- }
- else{
- printf("Cannot enter '-' or zero la!\n");
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement