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
Do you have any idea about the use of "auto" keyword?
Combinations of fibanocci prime series
Explain what is the benefit of using enum to declare a constant?
Write a program to identify if a given binary tree is balanced or not.
How can I manipulate individual bits?
What does nil mean in c?
What is the difference between int main and void main?
a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler
What is the purpose of & in scanf?
Define recursion in c.
What are preprocessor directives in c?
What does sizeof int return?
When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.
what is ur strangth & weekness
Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?