0
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)..
4 Respuestas
+ 1
Please first try to write code. If you are facing any problem then share with your question.
+ 1
Define a function of type string that takes an int as a parameter and returns "odd" or "even" using a simple if else statement.
0
i've tried but it says traped .. after getting the input from user ..
0
Sure next time I'll..