help here

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jwatson
    New Member
    • Nov 2006
    • 8

    help here

    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......
  • jeiem
    New Member
    • Nov 2006
    • 7

    #2
    reply

    #incude<stdio.h >
    int main()
    {
    for(int a=9;a<=0;a--)
    {
    printf("a");
    }
    return 0;
    }
    Last edited by jeiem; Nov 9 '06, 01:43 PM. Reason: not anwered the question

    Comment

    • jeiem
      New Member
      • Nov 2006
      • 7

      #3
      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

      Comment

      • momotaro
        Contributor
        • Sep 2006
        • 357

        #4
        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!

        Comment

        • jeiem
          New Member
          • Nov 2006
          • 7

          #5
          Originally posted by momotaro
          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...!

          Comment

          • jeiem
            New Member
            • Nov 2006
            • 7

            #6
            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;
            }

            Comment

            Working...