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;
}
 
Ad

Advertisements

Joined
Mar 3, 2021
Messages
243
Reaction score
29
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

Top