Can you please write the code for this problem??

hey all :D
I want to write this program using (For loop)

"Write a program that gives you the time table (from 1 to 10) of any number the user inputs."

can anyone help me??
how is the loop format going to be??

waiting for your help guys :D
Have you written any code? Or even a flowchart/pseudo code version?
no I didnt write any code yet.
but i just want to know how the loop going too look like.

but let me try

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <iostream>
using namespace std;

void main ()
{
int number
cout<<"please enter a number \n";
cin>>number;
for (i=number;;i=??? "here is my problem")
{
cout<<i <<endl;
}

system ("pause");
}
Looks like you need to read up on control structures.
http://www.cplusplus.com/doc/tutorial/control/

Read the bit about for loops. It should explain to you exactly how to set one up (and then some.)
oh so i cant leave the condition empty,
ok if i dont want to make a condition for the entered number, for example the user can
write any number he want, what should i write??
and can you please solve me this problem cause im having an exam really soon =(
The condition is for the `for loop'.
If the condition is met, the loop executes and the condition is check again.

If your problem is just the syntax, provide pseudo-code and I'll translate it for you.


¿Do you want us to solve your exam too?
closed account (18hRX9L8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* Usandfriend's Program for Times Tables. */
#include <stdio.h>

main()
{
      int i,j,product;
      printf ("This program prints a times table to 10.\n");
      printf ("Press enter to continue.\n");
      getchar();
      
      for(i=1;i<=10;i++)
      {
          for (j=1;j<=10;j++)
          {
              product=i*j;
              printf ("%d\t",product);
          }
          printf ("\n");
      }
      
getchar();
}
Topic archived. No new replies allowed.