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

What is methods in c?

1038


Can you think of a logic behind the game minesweeper.

2426


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

1122


What are predefined functions in c?

1045


What is the best way to store flag values in a program?

1020


What is the size of enum in bytes?

1049


Explain what is the difference between far and near ?

1063


explain what is fifo?

1033


What is structure in c definition?

996


Write a code to generate divisors of an integer?

1021


State the difference between x3 and x[3].

1069


what is the syallabus of computer science students in group- 1?

2280


What is volatile, register definition in C

1069


What are the advantages of union?

1032


Suggesting that there can be 62 seconds in a minute?

1009