what will happen if our function requires atleast one parameter and returns nothing execept some string of characters

i want to get an input from user and tell the user whether the numbr is even or odd.. i can do it by simply using if else conditional statement.. but i want to know can we do it by using functions? yes then how? as our function requires atleast one input(number) from user and returns a character string (even or odd)..

10/5/2019 8:11:26 PM

Muhammad Usman

5 Answers

New Answer


Post your code here, without looking it, it's difficult to tell what's going on.


Please first try to write code. If you are facing any problem then share with your question.


Define a function of type string that takes an int as a parameter and returns "odd" or "even" using a simple if else statement.


i've tried but it says traped .. after getting the input from user ..


Sure next time I'll..