Click here to Skip to main content
15,881,588 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Write a program which takes names of five countries as input and prints them in alphabetical
can you give me the code I have an exam tomorrow

What I have tried:

Write a program which takes names of five countries as input and prints them in alphabetical
I tried it in code blocks and it didnt give me the right program can you help me?
Posted
Updated 23-Jun-21 0:41am
Comments
Richard Deeming 23-Jun-21 5:46am    
No. Nobody here is going to help you cheat on your exam to earn a qualification you're not entitled to so that you can get a job you're not capable of performing.

If you genuinely can't write this program after taking your course, then writing code is not the career for you. Talk to your teacher about switching to something else.

What did you try? I assume nothing.

We are not here to do your homework.

But if you do not want to program it yourself you can find an example here:
C Program to Sort set of strings in alphabetical order[^]

Then you have a solution but you learned nothing.

You should try to learn C by some tutorials.
e.g.
C Tutorial - Learn C Programming[^]
C Programming examples with Output[^]
 
Share this answer
 
Comments
Maciej Los 23-Jun-21 7:15am    
5ed!
TheRealSteveJudge 23-Jun-21 8:12am    
Thank you, Maciej!
You can learn today enough of the C programming language in order to pass you exam tomorrow.
Read a good tutorial on C console I/O, for loops and qsort (or, alternatively strncmp if you wish to code yourself a sorting algorithm).
 
Share this answer
 
Comments
Maciej Los 23-Jun-21 7:15am    
5ed!
CPallini 23-Jun-21 7:23am    
Thank you, Maciej!
TheRealSteveJudge 23-Jun-21 8:13am    
5*
CPallini 23-Jun-21 8:14am    
Thank you!
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.

Even if we did, you wouldn't learn anything which would help you pass an exam tomorrow - this is a skill, which means that you develop (and improve) it by using it, not by "looking at what someone else did". You can watch people ride bicycles all you want, you are still going to fall off every time you try it until you have developed the skill!

So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.

If you are having problems getting started at all, then this may help: How to Write Code to Solve a Problem, A Beginner's Guide[^]
 
Share this answer
 
Comments
Maciej Los 23-Jun-21 7:15am    
5ed!
TheRealSteveJudge 23-Jun-21 8:14am    
5*

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900