Answer to Question #309209 in C for Nobody

Question #309209

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-10T10:18:47-0500
#include <stdio.h>


int main() {
    int y;
    int i;


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


    for (i=1; i<=8; i++) {
        printf("%d ", i*y);
    }
    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