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
Can true be a variable name in c?
Do you know the difference between exit() and _exit() function in c?
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
What is c programing language?
Tell us the use of fflush() function in c language?
write an algorithm to display a square matrix.
If errno contains a nonzero number, is there an error?
What is mean by data types in c?
Is there a way to jump out of a function or functions?
which type of aspect you want from the student.
what is stack , heap ,code segment,and data segment
What is p in text message?
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
How can I write functions that take a variable number of arguments?
In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)