- Joined
- Feb 4, 2011
- Sythe Gold
- 0
- Messages
- 147
Im very very new to c++, and have just started out learning it.
My Problem
I made a very simple console application and it worked fine, but i wanted to extend on it for some fun.
So here is what i have so far
As you can see, very basic.
but i want to change it, so at the very start, the user can choose too count backwards or forwards.
I tried something like this
but then i realized i have no idea how to figure out if the user typed 'y' or 'n'.
i tried creating a char variable then cheeking if it equaled 'y'. But, it would not work.
the next thing i thought would be using true/false, but still had no idea how to work out what the user types.
Please Help
C++ Exercises
Since im new to c++, i really wanted a way to track my progress. As you can see above i am still a noob
Anyways, i was hoping you could suggest a for 'exercises', so im able to see how far im coming along.
For example.
2 beginner applications
2 intermediate applications
2 advanced applications
thanks
My Problem
I made a very simple console application and it worked fine, but i wanted to extend on it for some fun.
So here is what i have so far
Code:
#include "stdafx.h"
#include <iostream>
using namespace std;
int main() {
int n1, n2, i;
cout << "Please Enter A Number: ";
cin >> n1;
cout << "Please Enter A Different Number: ";
cin >> n2;
if (n1 == n2)
cout << "Numbers are the same, Learn To Read";
else
if (n1 <= n2)
for (i = n1; i <= n2; i++)
cout << i << " ";
else
for (i = n2; i <= n1; i++)
cout << i << " ";
return 0;
}
but i want to change it, so at the very start, the user can choose too count backwards or forwards.
I tried something like this
Code:
cout << "Would you like to count backwards? (y/n): ";
i tried creating a char variable then cheeking if it equaled 'y'. But, it would not work.
the next thing i thought would be using true/false, but still had no idea how to work out what the user types.
Please Help
C++ Exercises
Since im new to c++, i really wanted a way to track my progress. As you can see above i am still a noob
Anyways, i was hoping you could suggest a for 'exercises', so im able to see how far im coming along.
For example.
2 beginner applications
2 intermediate applications
2 advanced applications
thanks


