Hello,
I've toyed with the idea of getting into programming in the past and recently dove in and took it as one of my classes this semester. I'm still trying to wrap my head around it, but I would like some guidance for this assignment. We're supposed to write a program that takes three input numbers (eg a, b, c) and then output them both forwards and backwards (c, b, a).
Here's the code that I've written so far:
#include <iostream>
using namespace std;
int main()
{
int a, b, c;
cout << "Enter 3 numbers " << endl;
cin >> a, b, c
cout << "Your numbers forwards" << a, b, c << endl;
cout << "Your numbers backwards" << c, b, a << endl;
return 0;
}
EDIT:
I actually figured it out on my own (I seem to be doing that a lot lately after I create a thread...), anyways, here's the code that I ended up with:
#include <iostream>
using namespace std;
int main()
{
int a;
int b;
int c;
cout << "Enter a value " << endl;
cin >> a;
cout << "Enter a value " << endl;
cin >> b;
cout << "Enter a value " << endl;
cin >> c;
cout << "Your numbers forwards" << endl;
cout << a << endl;
cout << b << endl;
cout << c << endl;
cout << "Your numbers backwards" << endl;
cout << c << endl;
cout << b << endl;
cout << a << endl;
return 0;
}
I've toyed with the idea of getting into programming in the past and recently dove in and took it as one of my classes this semester. I'm still trying to wrap my head around it, but I would like some guidance for this assignment. We're supposed to write a program that takes three input numbers (eg a, b, c) and then output them both forwards and backwards (c, b, a).
Here's the code that I've written so far:
#include <iostream>
using namespace std;
int main()
{
int a, b, c;
cout << "Enter 3 numbers " << endl;
cin >> a, b, c
cout << "Your numbers forwards" << a, b, c << endl;
cout << "Your numbers backwards" << c, b, a << endl;
return 0;
}
EDIT:
I actually figured it out on my own (I seem to be doing that a lot lately after I create a thread...), anyways, here's the code that I ended up with:
#include <iostream>
using namespace std;
int main()
{
int a;
int b;
int c;
cout << "Enter a value " << endl;
cin >> a;
cout << "Enter a value " << endl;
cin >> b;
cout << "Enter a value " << endl;
cin >> c;
cout << "Your numbers forwards" << endl;
cout << a << endl;
cout << b << endl;
cout << c << endl;
cout << "Your numbers backwards" << endl;
cout << c << endl;
cout << b << endl;
cout << a << endl;
return 0;
}