Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)

2355


I have seen function declarations that look like this

1059


What is the use of bit field?

1199


What are the 3 types of structures?

1047


Where define directive used?

1109


What is difference between Structure and Unions?

1270


How arrays can be passed to a user defined function

1040


How can I recover the file name given an open stream?

1043


How do you view the path?

1144


What is c system32 taskhostw exe?

1042


How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same

1128


What are control structures? What are the different types?

1105


What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?

1292


Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

1103


What are pointers? Why are they used?

1204