#include <stdio.h>
int main(void) {
int a, b, c;
printf("stage A stage B Hypotenuse\n");
for (a=1; a<1000; a++){
for(b=1;b<1000;b++){
for(c=1;c<1000;c++){
if(a*a+b*b==c*c){
printf(" %d %d %d\n",a,b,c);
}
}
}
}
This is what i did, how can i make each one come under the stage in a row?
}
Asked
Active
Viewed 77 times
-1

Iharob Al Asimi
- 52,653
- 6
- 59
- 97

farouk nuseibeh
- 1
- 1
1 Answers
0
Instead of '%d' you can put '%10d' (any number you want) to make a field that many digits wide.

Marlene
- 9
- 6