Login
Register
@
Dark Mode
Profile
Edit my Profile
Messages
My favorites
Register
Activity
Q&A
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous Years
Blogs
New Blog
Exams
Dark Mode
Parameter Passing Material
Recent questions tagged parameter-passing
3
votes
1
answer
1
GO Classes Test Series 2024 | Programming | Test 3 | Question: 19
#include<stdio.h> int test(int *a, int *b) { int c = *a-*b; if (c<0) return 0; else return (1 + test(&c, b)); } void main() { int x = 15; int y = 4; int a = test(&x,&y); printf("%d", a); } $2$ $3$ $4$ Run time error since we can not pass the address of local variable c in the function test.
GO Classes
asked
in
Programming in C
Apr 30, 2022
by
GO Classes
356
views
goclasses2024-programming-3-weekly-quiz
goclasses
programming
programming-in-c
functions
pointers
parameter-passing
recursion
2-marks
1
vote
1
answer
2
Self Doubt on scoping
int x = 5, y = 10 ; void main ( ) { int i = 2, j = 3 A (i, j); } void A (int i, int j) { int x = 10, y = 5 ; i = i + x : j = i + y : printf ("%d %d", i, j); B (i, j); } void B (int i, int j) { i ... by-name 3. call-by-need 4. call-by-value 5.Static scoping 6.Dynamic scoping Any reference for call by name and call by need Is for static coping $12,17,54$ or $12,17,59$?
srestha
asked
in
Programming in C
Mar 23, 2019
by
srestha
434
views
programming-in-c
dynamic-scoping
parameter-passing
0
votes
1
answer
3
parameter passing
#include<stdio.h> int fun(int arr[]) { arr=arr+1; printf("%d",arr[0]); } int main(void){ int arr[2]={10,20}; fun(arr); printf("%d",arr[0]); return 0; } A.COMPILE ERROR B.20,10 C.10,20 D.20,20
Arun Rout
asked
in
Programming in C
Jan 7, 2019
by
Arun Rout
679
views
parameter-passing
5
votes
2
answers
4
TIFR CSE 2019 | Part B | Question: 8
Consider the following program fragment: var a,b : integer; procedure G(c,d: integer); begin c:=c-d; d:=c+d; c:=d-c end; a:=2; b:=3; G(a,b); If both parameters to $G$ are passed by reference, what are the values of $a$ and $b$ at the end of the above program fragment ? $a=0$ and $b=2$ $a=3$ and $b=2$ $a=2$ and $b=3$ $a=1$ and $b=5$ None of the above
Arjun
asked
in
Programming in C
Dec 18, 2018
by
Arjun
1.9k
views
tifr2019
programming
parameter-passing
0
votes
1
answer
5
Parameter Passing
Predict the Output for both the snippets for the following: 1. Call by Value 2. Call by Reference 3. Call by Need 4. Call by Name 5. Call by value Result/Call by value Return(Copy Restore) 6. Call by Text
Balaji Jegan
asked
in
Programming in C
Nov 15, 2018
by
Balaji Jegan
1.3k
views
programming-in-c
parameter-passing
0
votes
0
answers
6
parameter passing technique
from below list of parameter passing techniques, which parameter passing technique we can implement in c? 1) call by value 2) call by refference 3) call by value result 4) call by name 5) call by text 6) call by need
Rahul_Rathod_
asked
in
Programming in C
Oct 3, 2018
by
Rahul_Rathod_
519
views
parameter-passing
programming
programming-in-c
0
votes
0
answers
7
parameter passing tech
why we use parameter passing technique in C?? OR purpose of using "parameter passing technique"?? OR what is the advantage of using it in C??
Hira Thakur
asked
in
Programming in C
Sep 13, 2018
by
Hira Thakur
298
views
parameter-passing
0
votes
0
answers
8
Test Series
What is the output.My doubt is : What is meant by call by copy restore ? is it same as call by reference or there is some difference ?
Na462
asked
in
Programming in C
May 2, 2018
by
Na462
390
views
programming-in-c
parameter-passing
0
votes
0
answers
9
parameter passing techniques
Does C support all passing parameters techniques like call by text, call by copy restore, and call by name?
Rishabh Baghel
asked
in
Programming in C
Mar 6, 2018
by
Rishabh Baghel
547
views
programming-in-c
parameter-passing
46
votes
5
answers
10
GATE CSE 2018 | Question: 29
#include<stdio.h> void fun1(char* s1, char* s2){ char* temp; temp = s1; s1 = s2; s2 = temp; } void fun2(char** s1, char** s2){ char* temp; temp = *s1; *s1 = *s2; *s2 = temp; } int main(){ char *str1="Hi", *str2 = "Bye"; fun1 ... of the program above is: $\text{Hi Bye Bye Hi}$ $\text{Hi Bye Hi Bye}$ $\text{Bye Hi Hi Bye}$ $\text{Bye Hi Bye Hi}$
gatecse
asked
in
Programming in C
Feb 14, 2018
by
gatecse
14.9k
views
gatecse-2018
programming-in-c
pointers
parameter-passing
normal
programming
2-marks
1
vote
1
answer
11
Virtual Gate Test Series: Programming & DS - Parameter Passing
int f(int &x, int c) { c = c-1; if (c == 0) return 1; x = x +1; return f(x,c) * x; } What is the return value of $f(p,p),$ if the value of $p$ is initialized to $4$ before the call$?$ Note that the first parameter is passed by reference, whereas the second parameter is passed by value.
Ahwan
asked
in
Programming in C
Aug 21, 2017
by
Ahwan
697
views
programming-in-c
parameter-passing
virtual-gate-test-series
5
votes
1
answer
12
Test by Bikram | Mock GATE | Test 2 | Question: 14
Consider the following code snippet. void first(int p, int t) { p += t; t += p; } main() { int p = 4; first(p , p); } What is the final value of $p$ in both call by value and call by reference respectively ? $4$ and $12$ $5$ and $12$ $12$ and $16$ $4$ and $16$
Bikram
asked
in
Compiler Design
Jan 24, 2017
by
Bikram
469
views
tbb-mockgate-2
compiler-design
parameter-passing
runtime-environment
0
votes
0
answers
13
CALL BY REFERENCE AND CALL BY NAME
foo(a, b, c) { b =b++; a = a++; c = a + b*10 } X=1; Y=2; Z=3; foo(X, Y+2, Z); CAN SOMEONE PLEASE TELL THE OUTPUTS FOR CALL BY REFERENCE AND CALL BY NAME. WHAT IS THE DIFERENCE BETWEEN CALL BY NAME AND CALL BY REFERENCE??
sushmita
asked
in
Compiler Design
Jan 18, 2017
by
sushmita
856
views
programming
parameter-passing
compiler-design
8
votes
2
answers
14
Test by Bikram | Mock GATE | Test 1 | Question: 9
Consider the following program fragment : int foo(int ,int ); int a; int ar[4] = { 1,0, 2,3}; main() { a = 0; foo(ar[a], ar[ar[a]]); printf("%d,%d ,%d,%d ", ar[0] , ar[1] ,ar[2] , ar[3]); } foo(int x, int y) { x= x+1; y ... be printed by the program if parameter passed by call by name? $1, 50, 2, 3$ $3, 50, 2, 3$ $3, 50, 3, 4$ $3, 2, 2, 3$
Bikram
asked
in
GATE
Jan 16, 2017
by
Bikram
1.5k
views
tbb-mockgate-1
parameter-passing
runtime-environment
compiler-design
5
votes
1
answer
15
GATE CSE 1988 | Question: 8i
Consider the procedure declaration: Procedure P (k: integer) where the parameter passing mechanism is call-by-value-result. Is it correct if the call, P (A[i]), where A is an array and i an integer, is implemented as below. create a new local variable, ... P using z for k; set A [i] to z; Explain your answer. If this is incorrect implementation, suggest a correct one.
go_editor
asked
in
Compiler Design
Dec 19, 2016
by
go_editor
1.7k
views
gate1988
descriptive
compiler-design
runtime-environment
parameter-passing
19
votes
1
answer
16
GATE CSE 1988 | Question: 2xv
What is printed by following program, assuming call-by reference method of passing parameters for all variables in the parameter list of procedure P? program Main(inout, output); var a, b:integer; procedure P(x, y, z:integer); begin y:=y+1 z:=x+x end P; begin a:=2; b:=3; p(a+b, a, a); Write(a) end.
go_editor
asked
in
Compiler Design
Dec 19, 2016
by
go_editor
2.2k
views
gate1988
descriptive
compiler-design
runtime-environment
parameter-passing
numerical-answers
4
votes
2
answers
17
GATE CSE 1990 | Question: 11a
What does the following program output? program module (input, output); var a:array [1...5] of integer; i, j: integer; procedure unknown (var b: integer, var c: integer); var i:integer; begin for i := 1 to 5 do a[i] := i; b:= 0; c := 0 for i := 1 to 5 do write (a[i]); ... b := 5; c := 6; end; begin i:=1; j:=3; unknown (a[i], a[j]); for i:=1 to 5 do write (a[i]); end;
makhdoom ghaya
asked
in
Compiler Design
Nov 25, 2016
by
makhdoom ghaya
1.7k
views
gate1990
descriptive
compiler-design
runtime-environment
parameter-passing
0
votes
2
answers
18
Kerala PSC AP Exam
The default parameter passing mechanism of functions is A) Call by Value B) Call by Reference C) Call by Result D) None of the above
Sankaranarayanan P.N
asked
in
Programming in C
Oct 27, 2016
by
Sankaranarayanan P.N
823
views
parameter-passing
6
votes
2
answers
19
GATE Overflow | Programming | Test 1 | Question: 14
void foo(int x) { int *p = &x; *p = x*x; } The above code is supposed to modify any input integer with its square. Which of the following statements regarding the above code is correct? The given code is wrong as ... not returning any value The given code is wrong as it is illegal to access the memory of a parameter variable inside a function
Arjun
asked
in
Programming in C
Oct 19, 2016
by
Arjun
879
views
go-programming-1
programming
programming-in-c
parameter-passing
3
votes
1
answer
20
UGC NET CSE | August 2016 | Part 3 | Question: 21
Assume that the program $‘P’$ is implementing parameter passing with ‘call by reference’. What will be printed by following print statements in $P$? Program P { x=10; y=3; funb(y,x,x) print x; print y; } funb (x,y,z) { y=y+4; z=x+y+z; } 10, 7 31, 3 10, 3 31, 7
makhdoom ghaya
asked
in
Compiler Design
Oct 1, 2016
by
makhdoom ghaya
1.9k
views
ugcnetcse-aug2016-paper3
parameter-passing
1
vote
1
answer
21
what is printed by pint stmt if P1 is assuming call by reference parameter passing?
Program P1() { x=10, y=3; func1(y,x,x); print x; print y; } func1(x,y,z) { y=y+4; z=x+y+4; } plzz elaborate the answer explanation? thanks in advance.
neha singh
asked
in
Programming in C
Aug 26, 2016
by
neha singh
889
views
parameter-passing
2
votes
2
answers
22
UGC NET CSE | December 2014 | Part 3 | Question: 19
Consider the following statements $S1, S2$ and $S3$: $S1$: In call-by-value, anything that is passed into a function call is unchanged in the caller's scope when the function returns. $S2$: In call-by-reference, a function receives implicit reference to a ... $S3$ and $S1$ are true. $S2$ and $S1$ are true. $S1, S2, S3$ are true.
makhdoom ghaya
asked
in
Compiler Design
Jul 25, 2016
by
makhdoom ghaya
2.8k
views
ugcnetcse-dec2014-paper3
compiler-design
runtime-environment
parameter-passing
1
vote
2
answers
23
UGC NET CSE | December 2012 | Part 3 | Question: 44
The Default Parameter Passing Mechanism is called as Call by Value Call by Reference Call by Address Call by Name
go_editor
asked
in
Programming and DS
Jul 13, 2016
by
go_editor
8.3k
views
ugcnetcse-dec2012-paper3
programming-in-c
parameter-passing
19
votes
2
answers
24
ISRO2015-80
Consider the following code fragment void foo(int x, int y) { x+=y; y+=x; } main() { int x=5.5; foo(x,x); } What is the final value of $\textsf{x}$ in both call by value and call by reference, respectively? $5$ and $16$ $5$ and $12$ $5$ and $20$ $12$ and $20$
go_editor
asked
in
Compiler Design
Jun 21, 2016
by
go_editor
7.1k
views
isro2015
compiler-design
runtime-environment
parameter-passing
7
votes
1
answer
25
CMI2010-A-08
In programming language terminology, $\text{ call by value }$ refers to the fact that: A function call can return a value. When a function is called, arguments are copied into local storage. Functions can indirectly modify the value of external variables. Every argument passed to a function must have a value.
go_editor
asked
in
Compiler Design
May 19, 2016
by
go_editor
1.2k
views
cmi2010
compiler-design
runtime-environment
parameter-passing
22
votes
3
answers
26
GATE CSE 1991 | Question: 09b
For the following code, indicate the output if static scope rules dynamic scope rules are used var a,b : integer; procedure P; a := 5; b := 10; end {P}; procedure Q; var a, b : integer; P; end {Q}; begin a := 1; b := 2; Q; Write ('a = ', a, 'b = ', b); end
go_editor
asked
in
Compiler Design
Apr 24, 2016
by
go_editor
4.2k
views
gate1991
runtime-environment
normal
compiler-design
parameter-passing
descriptive
Page:
1
2
3
next »
Subscribe to GATE CSE 2024 Test Series
Subscribe to GO Classes for GATE CSE 2024
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
-tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
Post GATE 2024 Guidance [Counseling tips and resources]
GATE CSE 2024 Result Responses
[Project Contest] Pytorch backend support for MLCommons Cpp Inference implementation
Participating in MLCommons Inference v4.0 submission (deadline is February 23 12pm IST)
IIITH PGEE 2024 Test Series by GO Classes
Subjects
All categories
General Aptitude
(3.5k)
Engineering Mathematics
(10.4k)
Digital Logic
(3.6k)
Programming and DS
(6.2k)
Algorithms
(4.8k)
Theory of Computation
(6.9k)
Compiler Design
(2.5k)
Operating System
(5.2k)
Databases
(4.8k)
CO and Architecture
(4.0k)
Computer Networks
(4.9k)
Artificial Intelligence
(79)
Machine Learning
(48)
Data Mining and Warehousing
(24)
Non GATE
(1.4k)
Others
(2.7k)
Admissions
(682)
Exam Queries
(1.6k)
Tier 1 Placement Questions
(17)
Job Queries
(80)
Projects
(11)
Unknown Category
(870)
64.3k
questions
77.9k
answers
243k
comments
79.7k
users
Recent questions tagged parameter-passing
Recent Blog Comments
Hlo I'm Rupesh I got AIR 3485 in gate CS and AIR...
@Ajay Sasank here is the direct link...
Thank you for the post didi My GATE 2023 & 2024...
I Hope it helps 😊
Today's best post I seen thank you for motivation