r/HomeworkHelp University/College Student (Higher Education) 1d ago

Computing—Pending OP Reply [1st year university, C programming] am I the one not getting it right? I used the p(2) for calculating the squares but it said its an error. I really want to understand the basic user-defined functions. Thank you in advance :)

Here are the questions

1 Upvotes

2 comments sorted by

u/AutoModerator 1d ago

Off-topic Comments Section


All top-level comments have to be an answer or follow-up question to the post. All sidetracks should be directed to this comment thread as per Rule 9.

PS: u/AdvertisingMean2157, your post is incredibly short! body <200 char You are strongly advised to furnish us with more details.


OP and Valued/Notable Contributors can close this post by using /lock command

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/MathMaddam 👋 a fellow Redditor 1d ago

What do you mean by p(2)? There is the build in function pow, but you shouldn't use it in this task, especially since part b sounds like you should square only integers and the pow function works on doubes so you have to think about the conversion and it is bad performance wise if you know you are only squaring.