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 double pointer?

985


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

999


Give differences between - new and malloc() , delete and free() ?

1079


What are local static variables? How can you use them?

1129


What is wrong in this statement?

1124


a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion

2764


What are linked lists in c?

1117


What is the size of enum in bytes?

1072


What are the types of operators in c?

1049


how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.

1674


What are register variables in c?

1004


Explain what are bus errors, memory faults, and core dumps?

1262


What does sizeof function do?

1178


How can you read a directory in a C program?

1127


What is the value of c?

1055