GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Placement Papers  >  Integra  >  Aptitude
Go To First  |  Previous Question  |  Next Question 
 Aptitude  |  Question 16 of 21    Print  
A question on call by value,
call by name,
call by reference.
f(x,y,z)
{
y := y+1;
z := z+x;
}
main()
{
int a,b;
a := 2
b := 2;
f(a+b,a,a);
print a;
}
What is the value of a printed for three different calls in main?


  
Total Answers and Comments: 1 Last Update: August 22, 2009   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
August 22, 2009 20:13:38   #1  
nithya_jganesh Member Since: July 2009   Contribution: 1    

RE: A question on call by value,ncall by name,ncall by reference.nf(x,y,z)n{ny := y+1;nz := z+x;n}nmain()n{nint a,b;na := 2nb := 2;nf(a+b,a,a);nprint a;n}nWhat is the value of a printed for three different calls in main?

f(4 2 2)
a 3;


 
Is this answer useful? Yes | No

 Related Questions

In the following question answer A, B, C, D depending on when the errors are detected? Array overbound A. if no error is detected B. if semantic and syntactic checking C. if during Code generation & Symbol allocation D. run time

In the following question answer A, B, C, D depending on when the errors are detected? Undeclared identifier A. if no error is detected B. if semantic and syntactic checking C. if during Code generation & Symbol allocation D. run time

In the following question answer A, B, C, D depending on when the errors are detected? Stack underflow A. if no error is detected B. if semantic and syntactic checking C. if during Code generation & Symbol allocation D. run time

In the following question answer A, B, C, D depending on when the errors are detected? Accessing an illegal memory location A. if no error is detected B. if semantic and syntactic checking C. if during Code generation & Symbol allocation D. run time

A question on call by value, call by name, call by reference. f(x,y,z) { y := y+1; z := z+x; } main() { int a,b; a := 2 b := 2; f(a+b,a,a); print a; } What is the value of a printed for three different calls in main?


 Sponsored Links

 
Related Articles

jQuery Reference

jQuery Reference Guide by Jonathan Chaffer and Karl Swedberg A Comprehensive Exploration of the Popular JavaScript Library jQuery Reference Guide packtpub com jquery reference guide Open Source book Anatomy of a jQuery Script He s got a brand new start Now he s a happy guy Categ
 

How is the main() function declared?

The declaration of main can be done as int main() One more declaration that can be taken by main is command line arguments form int main(int argc, char *argv[]) or this can also be written as int main(argc, argv) int argc; char *argv[]; NOTE: It is not possible for one to declare the main
 

How does the function call within function get evaluated?

Whenever we have more than one function which is called for a finite number of times then such a function gets evaluated from inside out. Let us understand this concept with an example. For instance consider a function sample called within it 4 times as given in program below: main() { int a=50;
 

What happens when a variable is not initialized in main function?

When a variable is not initialized in main function it contains garbage value. This can be well seen from the example below main() { int x; printf(“%d”,x); z= sample() } sample() { printf(“Testing program”); } Output is   &n
 

How to call C header that is not provided generally by system in C++?

Headers can be called by using extern C Syntax of extern C is: extern "C" <function declaration> for example to call C functions from C++ we can write extern "C" { <function declaration> <function declaration> ...
 

What is difference between call by value and call by reference in function?

The arguments passed to function can be of two types 1. Values passed 2. Address passed The first type refers to call by value and the second type refers to call by reference. For instance consider program1 main() { int x=50, y=70; interchange(x,y); printf(“x=%d y=%d”,x,
 

How To Write The Main Heading For Your Essay

How To Write The Main Heading For Your Essay When you write an essay you will want to make sure you write a good heading To write a good heading you will need to plan your essay very effectively If you remember any good points from lectures these could be things you may want to use to create a good
 

How To Save Time When Dealing With Phone Calls

How To Save Time When Dealing With Phone Calls While talking on the phone with clients can be important it can also waste your time if you don t know how to keep it under control Being able to properly handle phone calls will allow you to spend more time focusing on things which are important mosgoo
 

Call by Value and Call by Reference

Call by Value and Call by Reference In this tutorial you will learn about C Programming What is difference between call by value and call by reference in function mosgoogle The arguments passed to function can be of two types namely 1 Values passed 2 Address passed The first type refers to call by
 

Web Reference and Web Services

In this tutorial you will learn about Using Web Reference Adding a Web reference To create an ASP NET Web application Adding a Web Reference Testing a Web Service Accessing the XML Web Service and To access the XML Web service mosgoogle VB NET 2005 Tutorials Web Reference ASP NET Web Application an
 

Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape