Answer to Question #307887 in C for Jayson

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

1
Expert's answer
2022-03-08T13:06:57-0500
#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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS