初めて投稿し、C の初心者でもあります。私の問題は、不明な数の結果をどのように出力するかです。たとえば、次のコードをご覧ください。
#include <stdio.h>
int main(void)
{
int a,b,c;
b=0;
printf("Enter the number of terms: ");
scanf("%d", &a);
for(b=0; b<=a; ++a)
{
printf("\n\nEnter the value of each term: ");
scanf("%d",&c);
}
printf("\n\n%d",c);
return(0);
}
最後に入力したすべての値を出力したいのですが、1、2などの値を出力するように調整する方法を教えてください。
PS fprintfを使用して、whileループでもこれを行うにはどうすればよいですか。