I wrote this program, first I should say I'm an amature and I'm learning C++.
When I run this program if the input is a letter it returns you havent passed, but if the input is a number then the program halts and got hangged. whats the prob whit this program?
Im using DEV-C++ compiler
#include
#include
int main()
{
int grade;
printf("Please enter your grade: ");
scanf("%d",grade);
if(grade > 10)
{
printf("Your have passed the test.\n");
system("pause");
}
else
{
printf("You havent passed the text.\n");
system("pause");
return 0;
}
}
2007-03-31
00:50:58
·
3 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design