Click here to Skip to main content
16,022,189 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
1.write a program to identify whether a character entered by a user is a vowel or a consonant?
2.write a program to identify whether the number entered by user is even or odd?
3.write a program to accept a number from the user and display all the prime numbers from zero up to the number entered by user?
please i need the answers........its very
urgent.
Posted

wrote:
please i need the answers........its very
urgent.


Well it's your assignment so start coding. And hurry up, it's urgent!
 
Share this answer
 
How does giving someone this code, help them to learn ? I'm sorry, but any one of us could have answered this, we didn't because the OP has shown no willingness to learn, no willingness to do any research, no willingness to even try to do his own homework.
 
Share this answer
 
I agree with Christian. And enabling these people by answering them will only bring more of them here, which will reduce the quality of the entire Quick Answers system. Please don't answer obvious homework questions... they need to do their own work.
 
Share this answer
 
This is a guy who asked the same basic question over and over and couldn't understand any of the answers he got, so I suspect he thought he could redeem himself by answering a question.
 
Share this answer
 
These are fairly simple tasks and are usually given as homework, and as entry level interview questions. I suggest you open your books, you may even wish to consult some math books for questions 2 and 3. :doh:
 
Share this answer
 
wrote:
please i need the answers........its very


This is your assignment, try solving it yourself.
 
Share this answer
 
Better get a book and start studying. Its never too late buddy...
 
Share this answer
 
question 2:
if (num % 2 == 0)
   return "even";
return "odd";


Edit by DaveyM69:
Why return a string? Seeing as it's odd or even a boolean would make more sense IMO
C#
public static bool IsEven(int number)
{
    return number % 2 == 0;
}
 
Share this answer
 
v2

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