Thread: Write a Program in C to print the given strings in ascending order?

  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    3

    Question Write a Program in C to print the given strings in ascending order?

    sample i/p and o/p:
    Enter the number of strings: 3
    Enter names : Pentium4
    Celeron
    AMD
    Names are in ascending order

    AMD
    Celeron
    Pentium4

  2. #2
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Quote Originally Posted by sansanthosh View Post
    sample i/p and o/p:
    Enter the number of strings: 3
    Enter names : Pentium4
    Celeron
    AMD
    Names are in ascending order

    AMD
    Celeron
    Pentium4
    What's the plan? Drop off your assignment and pick up the completed program? I'm *not* impressed by your initiative, so far.

    On this site, you need to get your assignment started, and then, if and when you have a problem or question, post up your code, and we'll help you get over the problem, or answer your questions.

    The start is up to you, however. We're definitely not a short order service for programming requests.

  3. #3
    Registered User ledow's Avatar
    Join Date
    Dec 2011
    Posts
    435
    Better idea - if you're struggling by this point, give up your course and choose another. In the long run, everyone will be a lot better off, including you.

    By the sounds of your previous posts, you're just hoping for an answer each time and can't even be bothered to refer back to whatever notes you have been given, or a quick google.

    - Compiler warnings are like "Bridge Out Ahead" warnings. DON'T just ignore them.
    - A compiler error is something SO stupid that the compiler genuinely can't carry on with its job. A compiler warning is the compiler saying "Well, that's bloody stupid but if you WANT to ignore me..." and carrying on.
    - The best debugging tool in the world is a bunch of printf()'s for everything important around the bits you think might be wrong.

  4. #4
    Registered User
    Join Date
    Feb 2011
    Location
    Oslo, Norway
    Posts
    5
    You could put them in an array, and then use the value inside to sort it

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 04-01-2011, 04:13 PM
  2. ascending and descending order
    By ssk in forum C Programming
    Replies: 3
    Last Post: 03-25-2011, 08:03 PM
  3. Replies: 1
    Last Post: 05-30-2010, 10:22 PM
  4. Program to print 3 numbers in ascending order
    By jadedreality in forum C++ Programming
    Replies: 5
    Last Post: 11-08-2007, 07:32 PM
  5. Problem with ascending order Program
    By cashmerelc in forum C Programming
    Replies: 4
    Last Post: 09-21-2007, 05:36 PM