Answer to Question #300678 in C for Nobody

Question #300678

Create a program based on the sample output using while loop.


Enter a Number : 10


1*1 = 1

2*3 = 6

3*5 = 15

4*7 = 28

5*9 = 45


1
Expert's answer
2022-02-21T11:04:16-0500
#include <stdio.h>

int main()
{
    int a;
    printf("Enter a Number: ");
    scanf("%d", &a);
    for (int i = 1; i <= a/2; i++)
    {
        printf("%d*%d = %d\n", i, (i*2)-1, i*((i*2)-1));
    }

}

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