Replies
Welcome, guest
Join CrazyEngineers to reply, ask questions, and participate in conversations.
CrazyEngineers powered by Jatra Community Platform
-
@gauravbhorkar-Pf9kZD • Feb 28, 2011
-
@manish-r2Hoep • Feb 28, 2011
-
@reya-SMihdC • Feb 28, 2011
-
@hussanal-faroke-U5nNM8 • Feb 28, 2011
-
@manish-r2Hoep • Feb 28, 2011
Interesting
Any other way friends -
@gauravbhorkar-Pf9kZD • Mar 1, 2011
Haha... but that will hurt your fingers 😀Hussanal Farokemain()
{
pirntf("13579111315........99");
} -
@rajesh-s-qqMLTP • Mar 1, 2011
-
@praveenkumar-66Ze92 • Mar 2, 2011
Heard of Structures? Using that we can do in this way... 😀
struct ZeroEven { unsigned num : 1; } int main(){ ZeroEven ze; for (i=0; i<100; i++) { ze.num = i; if (ze.num != 0) cout<<i; } return 0; }Guys, do try this and say! 😀 -
@manish-r2Hoep • Mar 3, 2011
-
@praveenkumar-66Ze92 • Mar 3, 2011
Thanx... 😀goyal420This is what i was looking for Nice logic buddy
Any other way -
@rajesh-s-qqMLTP • Mar 3, 2011
is my logic not correct -
@gauravbhorkar-Pf9kZD • Mar 3, 2011
Nice solution. I never thought of using bit fields.praveenscienceHeard of Structures? Using that we can do in this way... 😀
struct ZeroEven { unsigned num : 1; } int main(){ ZeroEven ze; for (i=0; i<100; i++) { ze.num = i; if (ze.num != 0) cout<<i; } return 0; }Guys, do try this and say! 😀 -
@praveenkumar-66Ze92 • Mar 4, 2011
He he 😛 Thanx... 😁gaurav.bhorkarNice solution. I never thought of using bit fields. -
@sreekar-uzyqHj • Sep 18, 2014
-
@simplycoder-NsBEdD • Sep 28, 2014
#include<stdio.h> //simplycoder int main(int argc,char**argv) { int n=1; while(n<100) { if(n & 1 && printf("%d",n)); n++; } return 0; } -
@thebigk • Sep 28, 2014
Without wanting to distract this discussion; I think the guys who used print got it all right. Someone gotta beat that!
Or we need to rephrase the problem statement? -
@tim-rossiter-7Fnjpg • Sep 29, 2014
int main(int n) //init n=-1 { (n<99)?(printf("%d\n",main(n+2))):(n=n); //emote is colon left paren return(n); } -
@thebigk • Sep 29, 2014
#-Link-Snipped-# - You may use [code] .... [/code] tags to enter code without having to deal with emoticons. -
@tim-rossiter-7Fnjpg • Sep 29, 2014
Thanks -
@anoop-kumar-GDGRCn • Sep 29, 2014
I don't know C++ but here is java logic
void printOddNumbers(int maxLimit) { for(int i=1; i <= maxLimit; i+=2){ System.out.println("Odd : " +i); } }Number of iterations: maxLimit / 2 ; -
@avii-TGGs8o • Oct 2, 2014
well here's in Go, if that interests anyone:
package main import "fmt" func main() { for i := 1; i < 100; i+=2 { fmt.Println(i) } }