Home Ask Login Register

Developers Planet

Your answer is one click away!

farouk nuseibeh February 2016

How can i print the number under each stage and have it come out neat?

#include <stdio.h>

int main(void) {
    int a, b, c;

  printf("stage A   stage B  Hypotenuse\n");
    for (a=1; a<1000; a++){




                    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?


Marlene February 2016

Instead of '%d' you can put '%10d' (any number you want) to make a field that many digits wide.

Post Status

Asked in February 2016
Viewed 1,641 times
Voted 5
Answered 1 times


Leave an answer

Quote of the day: live life