2 Replies - 302 Views - Last Post: 05 December 2012 - 07:39 AM Rate Topic: -----

#1 Ashiq42  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 05-December 12

having touble using FUNCTION in C.

Posted 05 December 2012 - 07:29 AM

I was trying to find Odd and even number by using Function in C programing. I'm facing trouble in output. programe taking users input & also showing input but getting no output from it.I think i did something wrong in the expression. Is my code correct?? help me..Attached Image
Is This A Good Question/Topic? 0
  • +

Replies To: having touble using FUNCTION in C.

#2 raghav.naganathan  Icon User is offline

  • Perfectly Squared ;)
  • member icon

Reputation: 408
  • View blog
  • Posts: 1,440
  • Joined: 14-September 12

Re: having touble using FUNCTION in C.

Posted 05 December 2012 - 07:36 AM

Well, you need to do the calculations after you have input the number :)

In the sense, your line 9 will come after the line 11.

Also, the syntax of your scanf needs some change.

regards,
Raghav

This post has been edited by raghav.naganathan: 05 December 2012 - 07:38 AM

Was This Post Helpful? 1
  • +
  • -

#3 jimblumberg  Icon User is online

  • member icon


Reputation: 4074
  • View blog
  • Posts: 12,563
  • Joined: 25-December 09

Re: having touble using FUNCTION in C.

Posted 05 December 2012 - 07:39 AM

Please post your code as text, between code tags. Also you need to look up the documentation for scanf(), you need to send the address of your variables as parameters for this function. Also you may want to call your function after you retrieve the information from the user.

Jim
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1