Thread: Please Solve the two C programs..

  1. #1
    Registered User
    Join Date
    Oct 2009
    Posts
    4

    Please Solve the two C programs..

    Write a program which accepts the name and displays the alphabets which are not in the given name?

    another program:
    W.A.P. which accepts a sentence and print the word of the sentence whose number of occurrences in the sentence is maximum (always one word of the given sentence will have maximum recurrent).

    Thanks..

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #3
    Registered User
    Join Date
    Oct 2009
    Posts
    4
    Quote Originally Posted by Elysia View Post
    Okay.. okay Got it.. I am very new in this forum..

    My question was
    "a program which accepts the name and displays the alphabets which are not in the given name?"
    I can solve the problem..I can define the all alphabets in an array. I also can match the character in the name. But how can I print the previous array which are not matching..

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Let me ask you this then:
    If I gave you a name, and asked you to tell me which characters in the alphabet that is not in the name, how would you do it?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #5
    Registered User
    Join Date
    Oct 2009
    Posts
    4
    Quote Originally Posted by Elysia View Post
    Let me ask you this then:
    If I gave you a name, and asked you to tell me which characters in the alphabet that is not in the name, how would you do it?
    I will check if 'A' is in the name or not if no then print A .. then check 'B' if yes then don't print and so on..
    BUT it will be big program.. 26 times looping ..
    Please don't angry with me. Is there any easy way to solve?

  6. #6
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    You have the right idea.
    In C, you can use a character and increment it to find the next letter.
    For example,
    char x = 'A';
    x is now 'A'.
    x++;
    x is now 'B'.
    Similarly,
    x = 'a';
    x++;
    x is now 'b'.

    That should take care of your looping problem.
    Do not worry about me being angry. I am not. I am simply guiding you into thinking logically how to solve a problem. Handy stuff.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  7. #7
    Registered User
    Join Date
    Oct 2009
    Posts
    4
    Quote Originally Posted by Elysia View Post
    You have the right idea.
    In C, you can use a character and increment it to find the next letter.
    For example,
    char x = 'A';
    x is now 'A'.
    x++;
    x is now 'B'.
    Similarly,
    x = 'a';
    x++;
    x is now 'b'.

    That should take care of your looping problem.
    Do not worry about me being angry. I am not. I am simply guiding you into thinking logically how to solve a problem. Handy stuff.
    Ohhhh! Got it.. Thanks.. Thanks.. I can do that. Many thanks..

  8. #8
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Yeah, good luck. Check back if you have problems.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Starting programs
    By Molokai in forum C Programming
    Replies: 1
    Last Post: 04-16-2009, 10:10 AM
  2. Recommend upgrade path for C programs
    By emanresu in forum C Programming
    Replies: 3
    Last Post: 11-22-2007, 07:32 AM
  3. reducing global variables in windows programs
    By cozman in forum Windows Programming
    Replies: 38
    Last Post: 07-24-2002, 03:08 PM
  4. Two Struct & Class Programs that behave the same
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 07-05-2002, 09:59 AM
  5. Release MFC Programs & Dynamic MFC DLL :: MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 05-18-2002, 06:42 PM