Octal Decimal Hexadecimal conversions method 2

March 13, 2009 by admin  
Filed under C Plus Plus

#include

int main()
{
cout<<"The decimal value of 15 is "<<15< cout<<"The octal value of 15 is "< cout<<"The hex value of 15 is "<

return 0;

}

Octal Decimal Hexadecimal conversions

March 12, 2009 by admin  
Filed under C Plus Plus

#include
#include

int main()
{
cout<<"The decimal value of 15 is "<<15< cout<<"The octal value of 15 is "< cout<<"The hex value of 15 is "<

return 0;

}

write a character using cout

March 10, 2009 by admin  
Filed under C Plus Plus

#include
#include

int main()
{
char *url = “Programmershelp C++ code”;
while(*url)
cout.put (*url++);

cout< return 0;
}

Launch notepad

March 9, 2009 by admin  
Filed under C Plus Plus

/**************************************
launch notepad C++ version
***************************************/
#include
#include

int main(void)
{

cout<<"Explorer will launch.n"< /*replace with the path to your explorer.exe*/
system(”h:\windows\explorer.exe”);

return 0;
}

An if elese example

March 8, 2009 by admin  
Filed under C Plus Plus

#include
#include

int main()
{
double radius;
//get user input
cout<<"Please enter the radius : ";
cin>>radius;
//act on user input
if(radius < 0.0)
cout<<"Cannot have a negative radius"< else
cout<<"The area of the circle is "<<3.1416 * pow(radius,2)<

return 0;
}

Next Page »