Question #307887

Make a program that prints out the first 8 multiples of a given integer y. Please use


for loop.



Sample output:


Enter a number: 7


7 14 21 28 35 42 49 56

Expert's answer

#include <stdio.h>


int main() {
    int x, y;
    int i;


    printf("Enter a number: ");
    scanf("%d", &y);

    for (i=1; i<=8; i++) {
        x = i * y;
        printf("%d ", x);
    }

    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS