#include <stdio.h>
int main() {
int n, i;
// รับค่าจำนวนรอบที่ต้องการจากผู้ใช้
printf("Input number of terms: ");
scanf("%d", &n);
// ใช้ลูป for เพื่อวนซ้ำและคำนวณค่ากำลังสามของแต่ละจำนวน
for (i = 1; i <= n; i++) {
printf("Number is: %d and cube of the %d is: %d\n", i, i, i * i * i);
}
return 0;
}
#include <stdio.h>
int main() {
int n, i;
// รับค่าจำนวนรอบที่ต้องการจากผู้ใช้
printf("Input number of terms: ");
scanf("%d", &n);
// ใช้ลูป for เพื่อวนซ้ำและคำนวณค่ากำลังสามของแต่ละจำนวน
for (i = 1; i <= n; i++) {
printf("Number is: %d and cube of the %d is: %d\n", i, i, i * i * i);
}
return 0;
}