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

Do you have any idea about the use of "auto" keyword?

1048


Combinations of fibanocci prime series

1554


Explain what is the benefit of using enum to declare a constant?

1017


Write a program to identify if a given binary tree is balanced or not.

1089


How can I manipulate individual bits?

982


What does nil mean in c?

1176


What is the difference between int main and void main?

994


a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler

1018


What is the purpose of & in scanf?

1007


Define recursion in c.

1196


What are preprocessor directives in c?

1030


What does sizeof int return?

1021


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.

1933


what is ur strangth & weekness

2322


Which one to choose from 'initialization lists' or 'assignment', for the use in the constructor?

1014