Understanding this basic concept is key to writing Windows applications
very true. You had already justified it in your first reply. :)
Understanding this basic concept is key to writing Windows applications
very true. You had already justified it in your first reply. :)
bool isSingleDigit(int x)
{
if(x>=0 && x<10){
return true;
}
else{
return false;
}
}
int main(){
int y;
cin>>y;
bool z=isSingleDigit(int y);
if(z){
cout<<"the number is a single digit";
}
else{
cout<<"the number is not a single digit";
}
getch();
return 0;
}
compiler throws : Expected primary-expression before int for the line in bold/italics. Help.
Thank you. I will work on that part.
Hello People, I am quite a newbie to C++ programming and I got stuck up with a simple program. The program requires me to print the value for 2 raised to the power 20. I actually had the idea creeping about this program since 1 megabyte is 2 raised to the power 20. I wanted to find the result of that via this piece of code:
#include
#include
int main()
{
int a=2;
for (int i=2; i<=20; i++)
{
a=a*a;
}
cout<
and the output I get is: 0
The compiler/IDE I'm using is Borland C++ (latest version) but I know theres nothing wrong with the compiler though. There must be some logical mistake. Rectification would be appreciated folks. Hoping for help.
Thanks!
Rajdeep_