What is error in the code

Joined
Dec 5, 2021
Messages
1
Reaction score
0
#include<stdio.h>
void call_value(int b,int *f){
*f = 10*b;
}
int main()
{
int i, c;
printf("enter the value of i");
scanf("%d",i);
call_value(i,&c);
printf("the new value of i is %d",c);
return 0;
}
 
Joined
Mar 3, 2021
Messages
241
Reaction score
30
Hello! You forgot the ampersand during the scanf line. Switch it to the following.

C:
scanf("%d", &i);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top