Pointers
- What will be the output of the following C code?
#include <stdio.h>
void fun(int m, int n)
{
int temp = m;
m = n;
n = temp;
}
void main()
{
int s = 16, t = 15;
fun(s, t);
printf("%d %d\n", s, t);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
16 15
- What will be the output of the following C code?
#include <stdio.h>
void fun(int *ptr)
{
int k = 0;
for(k = 0; k < 4; k++)
printf("%d ", ptr[k]);
}
void main()
{
int n[5] = {16, 15, 13, 21};
fun(&n);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
16 15 13 21
- What will be the output of the following C code?
#include <stdio.h>
void fun(int *ptr1, int *ptr2)
{
int temp = *ptr1; *ptr1 = *ptr2; *ptr2 = temp;
}
void main()
{
int m = 10, n = 12;
fun(&m, &n);
printf("%d %d\n", m, n);
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
12 10
- What is the maximum number of arguments that can be passed in a single function?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
253
- Arguments that take input by user before running a program are called?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
Command-Line arguments