computing powers of n
• Input a number N
• Output powers of N using the while statement • 10 outputs
• Ex)
#include <stdio.h>
int main()
{
int n = 1;
printf("input number : ");
scanf("%d", &n);
int i = 1;
int p = 1;
while (i++ <= 10)
{
printf("%d\t", p = p * n);
}
}
你选错控制台了吧???