By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,605 Members | 1,491 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,605 IT Pros & Developers. It's quick & easy.

help here

P: 8
Hope you guys dun mind... me being a beginner in C programming. Few question need help.

A program:
Q1. a)Using for loop to print number from 9 to 0
b)All odd number between 0 to 9
c)all even number between 20 to 1(in descending order).....

Thanks alot......
Nov 9 '06 #1
Share this Question
Share on Google+
5 Replies


P: 7
#incude<stdio.h>
int main()
{
for(int a=9;a<=0;a--)
{
printf("a");
}
return 0;
}
Nov 9 '06 #2

P: 7
watson check the code out for the second part and i hope you are going to debug it?
dude get to me i can help you write the rest if you dont get them right?

see ya...later
gotta go
Nov 9 '06 #3

momotaro
100+
P: 357
for (a) use the code given above
for (b) use the same structure of the code above P.S need some small modifications and use % to determine the odd and the even Hint: a%b=0
even else odd ;)
for (c) well i think u got the idea!
see u!
Nov 9 '06 #4

P: 7
for (a) use the code given above
for (b) use the same structure of the code above P.S need some small modifications and use % to determine the odd and the even Hint: a%b=0
even else odd ;)
for (c) well i think u got the idea!
see u!
well i am here now and i think it has been a long time since i last wrote in c..
DId you debug the program well coz i think the error was syntatical or do you still need help...let me send you the code...!
Nov 9 '06 #5

P: 7
hey ye dude try this out i think it should work with out stress compile it and good luck with the rest other Holla at me...
#include<stdio.h>
void main()
{
int a;
for( a=9;a>=0;a--)
{
printf("%d",a);
}
//return 0;
}
Nov 9 '06 #6

Post your reply

Sign in to post your reply or Sign up for a free account.