❗ Need Challenging Problems To Solve
o.O
This was far beyond my imagination.
Thanks so much, I will try this.
I'm trying to understand every single bit before I move onto learning about functions and pointers.
---------- Post added at 05:18 PM ---------- Previous post was at 05:06 PM ----------
okay this is just still way too confusing.
This is what I'm planning to do:
The console screen will show numbers from 1-10 , and beside each number, will be the numbers that is multiplied by 2, 3, 4, until 10.
So.....like this:
1: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
2: 2, 4, 6, 8, 10.. etc you get my point.
3:
4:
5:
6:
7:
8:
9:
10:
I've done the numbers on the side, but with your second for loop statement, THIS is what happens.
11111111222222233333344444444555556666666677777777 77788888888999999999101010101010101010101010101010
?!?!?!?!?
This was far beyond my imagination.
Thanks so much, I will try this.
I'm trying to understand every single bit before I move onto learning about functions and pointers.
---------- Post added at 05:18 PM ---------- Previous post was at 05:06 PM ----------
okay this is just still way too confusing.
This is what I'm planning to do:
The console screen will show numbers from 1-10 , and beside each number, will be the numbers that is multiplied by 2, 3, 4, until 10.
So.....like this:
1: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
2: 2, 4, 6, 8, 10.. etc you get my point.
3:
4:
5:
6:
7:
8:
9:
10:
I've done the numbers on the side, but with your second for loop statement, THIS is what happens.
11111111222222233333344444444555556666666677777777 77788888888999999999101010101010101010101010101010
?!?!?!?!?
Ok.. I'm not good at teaching, so I've made the code for you... Just try to understand what i does 
Btw, I prefer using printf and scanf rather than cout and cin...
But they are basically the same thing...

Code:
#include <stdio.h>
#include <stdlib.h>
int main(){
for(int i = 1; i <= 10; i++){
printf("%2d: ", i); //Show the Number on the Left... the %2d makes the output look 'cleaner' forcing it display
//each number with 2 digits space...
for(int j = 1; j <= 10; j++){
printf("%2d, ", i*j); //Show the multiplication :)
}
printf("\n"); //New Line
}
system("pause"); //Wait for input to finish the program
}
But they are basically the same thing...1st Loop: Loops through the first operand of the multiplication.
2nd Loop: Loops through the second operand of the multiplication.
this way you can do like 1x1, 1x2, 1x3, .. when the second operand reaches ten, it breaks the inside loop and increment the outside one and do all that again...
2nd Loop: Loops through the second operand of the multiplication.
this way you can do like 1x1, 1x2, 1x3, .. when the second operand reaches ten, it breaks the inside loop and increment the outside one and do all that again...
i can explain:
i hope its clear
i never been good at writing tuts 
any ways here is another challenge
try to do it again but this time in pyramid style (dont repeat any multiplying like if you put 4*5 dont put 5*4
example:
you will need to know how to:
use for loop
use if statement
Code:
x 1 2 3 4 5 6 7 8 9 10 <-- loop (1~10) ---| 1 1 2 3 4 5 6 7 8 9 10 <-- loop (1~10) ---| 2 2 4 6 8 10 12 14 16 18 20 <-- loop (1~10) ---| 3 3 6 9 12 15 18 21 24 27 30 <-- loop (1~10) ---| 4 4 8 12 16 20 24 28 32 36 40 <-- loop (1~10) ---| 5 5 10 15 20 25 30 35 40 45 50 <-- loop (1~10) ---|---------- biggger loop (1~10) 6 6 12 18 24 30 36 42 48 54 60 <-- loop (1~10) ---| 7 7 14 21 28 35 42 49 56 63 70 <-- loop (1~10) ---| 8 8 16 24 32 40 48 56 64 72 80 <-- loop (1~10) ---| 9 9 18 27 36 45 54 63 72 81 90 <-- loop (1~10) ---| 10 10 20 30 40 50 60 70 80 90 100 <-- loop (1~10) ---|
i never been good at writing tuts 
any ways here is another challenge
try to do it again but this time in pyramid style (dont repeat any multiplying like if you put 4*5 dont put 5*4
example:
Code:
x 1 2 3 4 5 6 7 8 9 10 1 1 2 3 4 5 6 7 8 9 10 2 4 6 8 10 12 14 16 18 20 3 9 12 15 18 21 24 27 30 4 16 20 24 28 32 36 40 too lazy to complete the table :p
use for loop
use if statement
Challenge is kind of confusing lol.
How about this challenge? (I'm going to do this one tomorrow, not today)
So the program will ask me if I want to do addition, subtraction, mult, and div. I select one, and it will ask me to enter any digit. I enter one, then it will automatically add the sign I picked, let's just say multiplication, then it will ask me for another digit, then I enter another, then it will tell me the correct answer.
Then after each question, it will ask me this : "1. Would you like to continue asking questions in different math type? 2. Would you like to continue on the same math type? 3. Would you like to exit the program? <1/2/3>" So then if I enter blah blah blah you know what will happen blah blah blah.
TOO MANY TYPING I WILL END HERE.
PS: Jesus....how the fuck am I going to get past pointers...
How about this challenge? (I'm going to do this one tomorrow, not today)
So the program will ask me if I want to do addition, subtraction, mult, and div. I select one, and it will ask me to enter any digit. I enter one, then it will automatically add the sign I picked, let's just say multiplication, then it will ask me for another digit, then I enter another, then it will tell me the correct answer.
Then after each question, it will ask me this : "1. Would you like to continue asking questions in different math type? 2. Would you like to continue on the same math type? 3. Would you like to exit the program? <1/2/3>" So then if I enter blah blah blah you know what will happen blah blah blah.
TOO MANY TYPING I WILL END HERE.
PS: Jesus....how the fuck am I going to get past pointers...
I'm still KIND of confused about for loops and while loops..
Oh and btw bro, do you know like when you a while loop statement, at the end where you make the program ask something with a yes or no question, like "would you like to enter another digit? y/n" how do I make it so that if I press "y", it will loop back again until I press "n"?
Like I've tried stuff like:
and..
even tried...
loop++;
nothing worked lol.
Oh and btw bro, do you know like when you a while loop statement, at the end where you make the program ask something with a yes or no question, like "would you like to enter another digit? y/n" how do I make it so that if I press "y", it will loop back again until I press "n"?
Like I've tried stuff like:
Code:
if(choice=='y')
{
loop;
}
Code:
if(choice=='y')
{
while;
}
loop++;
nothing worked lol.
Handwritten, sorry if something is wrong 

Your answer
Code:
#include <iostream>
#include <string>
using namespace std;
string yes;
string no;
string indicator;
int main()
{
(while indicator == yes)
{
//your code
cout << "Another time\?" << endl;
cin >> indicator
}
}
You can also do it this way
Not handwritten
@MarkHC since when do you code C++?
//================================================== =================
Got one for you; make a log of mousepositions and save it in a file using this and the iostream and fstream
Code:
#include <iostream>
#include <string>
using namespace std;
string yes = "yes";
string no = "no";
string indicator;
int main()
{
do
{
cout << "Hi there!" << endl;
cout << "Another time\?" << endl;
cin >> indicator;
}while(indicator == yes);
}
@MarkHC since when do you code C++?//================================================== =================
Got one for you; make a log of mousepositions and save it in a file using this and the iostream and fstream
This thread is closed for replies.
