hello everyone, i'm a college student and am starting to tackle C++
i'm supposed to create a program that looks like the computer is talking to the user. here is my source code:
every time i run the program -12 always shows as the age why is that??Code:/*Computer AI*/ #include <stdio.h> #include <conio.h> main() {/*start of program*/ int age; char nickname[10]; clrscr(); printf ("What's your name?"); scanf ("%s", &nickname); printf ("Hello %s.", &nickname); printf ("\nHow old are you?"); scanf ("%d", &age); printf ("you're %d yrs old?", &age); getch(); return(0); }
please help thanks!!



LinkBack URL
About LinkBacks




Many years ago I had a copy of