24 lines
351 B
C
24 lines
351 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <math.h>
|
|
|
|
int main()
|
|
{
|
|
|
|
int x, result;
|
|
int y = 2;
|
|
|
|
printf("Please enter a number: ");
|
|
scanf("%d", &x);
|
|
|
|
printf("\n");
|
|
|
|
for (int i = 2; i <= 8; i = i + 2)
|
|
{
|
|
result = (int)pow(x, y);
|
|
printf("%d^%d: %d\n", x, y, result);
|
|
y = y + 2;
|
|
}
|
|
|
|
return 0;
|
|
} |