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

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

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 users 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

Your display should like this:

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
Asked:
rmrivera67
  • 4
  • 3
  • 2
  • +1
1 Solution
 
ozoCommented:
How far have you gotten, and what part are you having difficulty with?
0
 
n_i_c_oCommented:
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
 
n_i_c_oCommented:
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Infinity08Commented:
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
 
n_i_c_oCommented:
Sorry about this.
I am new to the site. Will read the rules more carefully.
Regards,
N.
0
 
Infinity08Commented:
That's ok, n_i_c_o. I was merely pointing it out ;)
0
 
Infinity08Commented:
rmrivera67, did you get the help you wanted ? You don't have to accept an answer if you didn't.
0
 
rmrivera67Author Commented:
no didn't receive the response i needed, but the response was sufficient.
0
 
Infinity08Commented:
>> 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
 
rmrivera67Author Commented:
What I meant was that it was not necessary to proceed further with this. Thanks.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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