um i just starded macking a simple program and i want the user to input a number when it says enter a number then i want it to say that number *3 is, enter then the answer will appear here is what i have and i dont know whats wrong with it
#include <stdlib.h>
using namespace std;
int main(int argc, char **argv)
{
int k,n;
n = k*3;
cout << "type a number";
cout << k << "times three is";
cin>>n;
system ("pause"); /* execute M$-DOS' pause command */
return 0;
)
You haven't even got the user input.
set up variables properly:
int k = 0;
int n = 0;
prompt the user:
cout << "type a freaking number --> ";
get the input
cin >> k;
multiply by three:
n = k*3;
then display the new result:
cout << endl << n;
Reputation Points: 113
Solved Threads: 19
Postaholic
Offline 2,108 posts
since Jun 2004