answersLogoWhite

0


Best Answer

i'll take a stab at it, though i'm a java person..

#include<stdio.h>

main() {

for (int i = 1; i<9;){ printf(i); i*=-1; if(i<0) i-=2;

else

i+=2;

}

}

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How can you print 1 -3 5 -7 9 in c code?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Java code to print prime numbers from 1 to 10?

System.out.println("2, 3, 5, 7"); There are so few you dont need to calculate it


How do you print a series 1 plus 3 plus 5 plus 7 in basic?

EXAMPLE 1 PRINT 1+3+5+7 EXAMPLE 2 FOR num% = 1 TO 7 STEP 2 total%=total%+num% NEXT PRINT total%


How do you print in c 1 2 3 4 5 6?

Any of the following are snippets of code providing some ways of doing it: printf("1 2 3 4 5 6"); write(0, "1 2 3 4 5 6", 11); puts("1 2 3 4 5 6"); for (i = 0; i++ &lt; 5; printf("%d ", i); printf("%d", i); for (i = 0; ++i &lt; 6; putchar(' ')) putchar('0' + i); putchar('0' + i);


Write a java program to print the following output using the for loop 1 2 2 3 3 3 4 4 4 4 5 5 5 5 5?

12345 1234 123 12 1


Where can find hobo 1 to 5 all codes?

Oh, dude, finding Hobo 1 to 5 codes is like searching for buried treasure in a landfill. You can try scouring the internet for forums or cheat code websites, but honestly, who has time for that? Just play the game and embrace the chaos, man.


What is the firing order for 2005 Chevy Impala?

3400 (LA1) Code E Engine: 1-2-3-4-5-6; 3800 (L36) Code K Engine: 1-6-5-4-3-2; 3800 (L67) Code 1 Supercharged Engine: 1-6-5-4-3-2.....


What is the firing order for a 2005 Chevy Impala?

3400 (LA1) Code E Engine: 1-2-3-4-5-6; 3800 (L36) Code K Engine: 1-6-5-4-3-2; 3800 (L67) Code 1 Supercharged Engine: 1-6-5-4-3-2.....


What is the code for a Hyundai stereo?

1 - 2 - 3 - 4 - 5


How do you open the brief case on pupzzle?

you putt the code in 5 3 2 1 2 1 3


Bubble blast valentine 1-69 cheat code?

3-3...3-3....3-3....3-4.....5-3.....5-3....


How do you generate 1 22 333 4444 55555 series in qbasic?

REMPATTERNS (not necessary) CLS FOR I = 1 TO 5 STEP +1 FOR J = 1 TO I STEP+1 PRINT J NEXT J PRINT NEXT I END Hope you find this helpful :)


How do you print kamal kama kam ka k this pattern in qbasic?

QBASIC CODE/START... ==== ...QBASIC CODE/END.