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...


In the below code, how do you modify the value 'a' and print
in the function. You'll be allowed to add code only inside
the called function.

main()
{
int a=5;
function(); // no parameters should be passed
}
function()
{
/* add code here to modify the value of and print here */
}



In the below code, how do you modify the value 'a' and print in the function. You'l..

Answer / aravind

#include<stdio.h>
void function(void );
int main()
{
int a=5;
function();
}
function()
{
int a=4;
printf("%d",a); /* a here is a local variable*/
}

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Interview Questions

What is a spanning Tree?

1 Answers   TCS,


What are qualifiers?

0 Answers  


for (i <= 5 && i >= -1;++i; i > 0) { printf("%d ", i); }

1 Answers  


the number 138 is called well ordered number because the three digits in the number (1,3,8) increase from left to right (1<3<8). the number 365 is not well ordered coz 6 is larger than 5. write a program that wull find and display all possible three digit well ordered numbers. sample: 123,124,125,126,127,128,129,134 ,135,136,137,138,139,145,146,147 148 149,156.......789

5 Answers  


if ENTERED FIVE DIGITS DESIGN A PROGRAM THAT WILL FIND CORRESPONDING VALUE FROM ASCII TABLE

1 Answers  


void main() { int i=5; printf("%d",i++ + ++i); }

21 Answers   ME,


Can variables be declared anywhere in c?

0 Answers  


What is the difference between array and linked list in c?

0 Answers  


Are there namespaces in c?

0 Answers  


How would you sort a linked list?

1 Answers  


Explain what is operator promotion?

0 Answers  


Discuss similarities and differences of Multiprogramming OS and multiprocessing OS?

4 Answers   TCS,


Categories