hey... i have to print 1 to 100 number without declaring any variable n using semicolon only once...so..how can u do this...
DO it in C
Collapse
X
-
[code=cpp]Originally posted by Anoopnegihey... i have to print 1 to 100 number without declaring any variable n using semicolon only once...so..how can u do this...
#include <iostream>
using namespace std;
int main()
{
cout << 1 << 2 << 3 << 4 << 5 << 6 << 7 << 8 << 9 << 10 << 11 << 12 etc... ;
return 0;
}
[/code]
Also, please read the posting guidelines. -
Of course your question has nothing to do with serious software development.Originally posted by Anoopnegihey... i have to print 1 to 100 number without declaring any variable n using semicolon only once...so..how can u do this...
Better try at the IOCCC for that type of fun.
kind regards,
JosComment
-
That's not C.Originally posted by ilikepython[code=cpp]
#include <iostream>
using namespace std;
int main()
{
cout << 1 << 2 << 3 << 4 << 5 << 6 << 7 << 8 << 9 << 10 << 11 << 12 etc... ;
return 0;
}
[/code]
Also, please read the posting guidelines.
kind regards,
Jos ;-)Comment
-
Well, come on, convertng it to C shouldn't be too hard. ;)Originally posted by JosAHThat's not C.
kind regards,
Jos ;-)Comment
Comment