[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
• Status: Solved
• Priority: Medium
• Security: Public
• Views: 2053

# multiplication table in miracle c

I have to  Write the pseudo code and the C source code for the following:

Write a multiplication table of users choice in descending order.

1. Prompt the user to enter number

2. Display the multiplication table using for loop

Example:  If user enters number 5

User requested to show the 5 times multiplication table:

5 times multiplication table is:

5  x   20  =  100

5   x  19  =   95

&..

5  x  1   =     5

How would I do this in miracle c
0
rmrivera67
• 4
• 3
• 2
• +1
1 Solution

Commented:
How far have you gotten, and what part are you having difficulty with?
0

Commented:
Hi,
here is what you need:

pseudo code:

- save user input into variable num
- for i from 20 to 0 in -1 increment do

miracle C code:

#include <stdio.h>

int main(int, char**)
{
int num,i;
printf("Enter number:");
fscanf(stdin, "%d", &num);

for (i = 20; i > 0; i--)
printf("%d x %d = %d\n", i, num, i*num);

getchar();
return 0;
}
0

Commented:
Hi,
here is what you need:

pseudo code:

- save user input into variable num
- for i from 20 to 0 in -1 increment do
- print i, num, i*num
- end for

miracle C code:

#include <stdio.h>

int main(int, char**)
{
int num,i;
printf("Enter number:");
fscanf(stdin, "%d", &num);

for (i = 20; i > 0; i--)
printf("%d x %d = %d\n", i, num, i*num);

getchar();
return 0;
}
0

Commented:
n_i_c_o, you shouldn't post complete source code for an assignment. Instead you should help the asker solve the problem himself. Not only is that in the rules of this site, it's also the best way to teach something like this.
0

Commented:
I am new to the site. Will read the rules more carefully.
Regards,
N.
0

Commented:
That's ok, n_i_c_o. I was merely pointing it out ;)
0

Commented:
rmrivera67, did you get the help you wanted ? You don't have to accept an answer if you didn't.
0

Author Commented:
no didn't receive the response i needed, but the response was sufficient.
0

Commented:
>> no didn't receive the response i needed, but the response was sufficient.

???? I don't get that ... Did you want help or not ? The answer you accepted was just asking for clarification which you never gave ...

Anyway ...
0

Author Commented:
What I meant was that it was not necessary to proceed further with this. Thanks.
0

## Featured Post

• 4
• 3
• 2
• +1
Tackle projects and never again get stuck behind a technical roadblock.