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
What is methods in c?
Can you think of a logic behind the game minesweeper.
if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above
What are predefined functions in c?
What is the best way to store flag values in a program?
What is the size of enum in bytes?
Explain what is the difference between far and near ?
explain what is fifo?
What is structure in c definition?
Write a code to generate divisors of an integer?
State the difference between x3 and x[3].
what is the syallabus of computer science students in group- 1?
What is volatile, register definition in C
What are the advantages of union?
Suggesting that there can be 62 seconds in a minute?