プロが教えるわが家の防犯対策術!

c言語プログラミングで10〜-10までの整数を連続して表示するプログラムを作成できるかたいますか?
結果
10
9
8...
プログラミングを最近初めて教えていただける方お願いします

A 回答 (4件)

// あ、間違えた!



for( count=10; count>=-10; count-- )
    • good
    • 0

// こんなのでいいのかな?



#include <stdio.h>

int main( void )
{
int count;

for( count=10; count<=10; count-- )
printf( "%d\n", count );

return 0;
}
    • good
    • 0

#include <stdio.h>



int main(void)
{
printf("10\n");
printf("9\n");
printf("8\n");
printf("7\n");
printf("6\n");
printf("5\n");
printf("4\n");
printf("3\n");
printf("2\n");
printf("1\n");
printf("0\n");
printf("-1\n");
printf("-2\n");
printf("-3\n");
printf("-4\n");
printf("-5\n");
printf("-6\n");
printf("-7\n");
printf("-8\n");
printf("-9\n");
printf("-10\n");
return 0;
}
    • good
    • 4

います。

    • good
    • 0

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!