I'd like to find a triple value by adding 5 to the number I entered in the user function practice, but I don't know what to write in the calc
part.I would appreciate it if you could tell me.
You can only change the calc()//description
.
#include<stdio.h>
# include <math.h>
calc()// Description
int main()
{
int x, y;
scanf("%d", & x);
y = calc(x);
printf("Answer=%d",y);
return(0);
}
It may be easy to get an answer, but it is not good for the questioner.I recommend that you study hard from the basics.
// First, just how to write a function
int calc(intx){
Return x;//x as it is.Let's think about the four rules by ourselves.
}
Here is an example answer.I think the reference site will be helpful.
Reference site: https://www.sejuku.net/blog/24348
int calc(intx)
{
return(x+5)*3;
}
You will find pages like Introduction to C language by searching for keywords such as "C language""Introduction""Beginner"
Using Google and other search sites is the most basic network literacy.
© 2024 OneMinuteCode. All rights reserved.