Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / C++

Amusing C++: funny tricks

3.00/5 (2 votes)
1 Nov 2011CPOL 13.9K  
Try this one://Can we print all integers from 1 to 30??/int x = 0;while (x < 30){ _tprintf(_T(X = %dn), ++x);}

Try this one:


C#
//Can we print all integers from 1 to 30??/
int x = 0;
while (x < 30)
{
  _tprintf(_T("X = %d\n"), ++x);
}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)