Ideas for C Programming Practice

Page 1 of 1

1 Replies - 773 Views - Last Post: 05 August 2012 - 09:44 AM Rate Topic: -----

#1 Takuya  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 05-August 12

Ideas for C Programming Practice

Posted 05 August 2012 - 09:24 AM

I have just recently been introduced to the world of programming in C and have been extremely active over the few days that I've been learning.
I've gotten to the point where I've run out of ideas for simple programs to write.

I've done things like counting the numbers of even/odd numbers that have been entered:


void sort( int argc, char *argv[] ) {

  int numTrack = 1;
  int oddTrack = 0;
  int evenTrack = 0;

  while( numTrack < argc ) {
    char *p = argv[numTrack];

      if( p[strlen(p) - 1]%2 == 0 ) {
        evenTrack++;
      } else {
        oddTrack++;
      }
      numTrack++;
  }

  printf( "\n" );
  printf( "Odd: %d\n", oddTrack );
  printf( "Even: %d\n", evenTrack );
  printf( "\n" );
}

main( int argc, char *argv[] ) {
  sort( argc, argv );

}




That snippet of code basically encompasses my knowledge of C thus far.
So, any ideas, even one, would help a lot!

Thanks in advance, Takuya.

Is This A Good Question/Topic? 0
  • +

Replies To: Ideas for C Programming Practice

#2 GunnerInc  Icon User is online

  • "Hurry up and wait"
  • member icon




Reputation: 719
  • View blog
  • Posts: 1,976
  • Joined: 28-March 11

Re: Ideas for C Programming Practice

Posted 05 August 2012 - 09:44 AM

The board has a great search feature!

Project Ideas....
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1