View Code of Problem 90

#include <stdio.h>
int main(){
  int a,b;
  scanf("%d%d",&a,&b);
  int x=a,y,z;
  while(x<=b)
  if(x^2+y^2=z^2){
    if((x>=a&&x<b)&&(y>=a&&y<b)&&(z>=a&&z<b)){
      printf("%d^2+%d^2=%d^2",x,y,z);
    
    }
	x++;  
  }
  

return 0;
}
/*
Main.c: In function 'main':
Main.c:7:9: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
   if(x^2+y^2=z^2){
         ^
Main.c:7:13: error: lvalue required as left operand of assignment
   if(x^2+y^2=z^2){
             ^
*/

Double click to view unformatted code.


Back to problem 90