1,574 views

2 Answers

Best answer
4 4 votes
a is called by value so any modification in a will be lost.
b is call also call by value but being a pointer, the dereferenced effect is visible in caller function (call by pointer) so modification will be there.
same for c.

final values of a,b,c are 5,20,20.
• selected by
Answer:
Position:
Show:

Related questions

6 6 votes
2 answers 2 answers
1.3k
1.3k views
Arjun asked Oct 18, 2016
1,271 views
What is the output of this program?#include <stdio.h int main() { char *ptr; char string[] = "Hello 2017"; ptr = string; ptr += 4; printf("%s",++ptr); }Hello 2017ello 201...
9 9 votes
2 2 answers
2.8k
2.8k views
Arjun asked Oct 18, 2016
2,839 views
Consider the following C function:void foo() { int a[10][20][30] = {0}; __________ printf("%d", a[3][4][5]); }Which of the following could be used in the missing line so ...
6 6 votes
1 1 answer
3.3k
3.3k views
Arjun asked Oct 18, 2016
3,287 views
Consider the following incomplete C function for reversing a singly linked list.node* reverse(node* trav){ if(trav->next) __________________ else { head - next = null; he...
9 9 votes
2 answers 2 answers
2.4k
2.4k views
Arjun asked Oct 18, 2016
2,395 views
int foo(int n) { if(n 10000) return 1; int sum = 0, i; for( i = 0; i < n; i++) { sum += i; } return sum; }The value returned by the above function is$\Theta\left(n^2\rig...