Explain this code.
#include <stdio.h>
void f1(int *k)
{
*k = *k + 10;
}
main ( ){
int i;
i = 0;
printf (" The value of i before call %d \n", i);
f1 (&i);
printf (" The value of i after call %d \n", i);
}
Answer Posted / ankita sharma
answer will be 10. as k has the address of i so when we write *k=*k+10; *k meand that value to which k is pointing so it is pointing to i and i has the value 0 as intial value so 10 would be added to the value of i. so output will be 10.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
how to write optimum code to divide a 50 digit number with a 25 digit number??
can any one tel me wt is the question pattern for NIC exam
What is string constants?
When would you use a pointer to a function?
a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above
What is the correct declaration of main?
write a C program: To recognize date of any format even formats like "feb-02-2003","02-february-2003",mm/dd/yy, dd/mm/yy and display it as mm/dd/yy.
Is null a keyword in c?
Between macros and functions,which is better to use and why?
What is clrscr ()?
Explain high-order bytes.
How to set file pointer to beginning c?
why do some people write if(0 == x) instead of if(x == 0)?
FILE PROGRAMMING
What is omp_num_threads?