In: Computer Science
1. Design the logic for a program that outputs every multiple of
4, from 4 through 100
along with its value squared and cubed, e.g.,
The next number: 4
Squared: 16
Cubed: 64
The next number: 8
Squared: 64
Cubed: 512
//I am presenting the logic in c language
#include <stdio.h>
int main()
{
for(int i=4;i<=100;i=i+4)//loops from 4 to 100 increments by 4
at a time
{
printf("The next number:%d\n",i);//the number
printf("Squared:%d\n",i*i);//sqaure of number num * num
printf("Cubed:%d\n",i*i*i);//cube of a number num * num * num
}
return 0;
}