• retagged by
1,522 views
4 4 votes

Point out the error :
 

#include <stdio.h>
void f(int*);
int main()
{
    int i=35,*z;
    z=f(&i);
    printf("%d",z);
    return 0;
}
void f(int*m)
{
    return(m+2);
}
  1. error in function call
  2. error in return statement
  3. error in argument of f()  
  4. error in pointer initialization

1 Answer

Best answer
9 9 votes
A void function cannot return a value though it can have a return statement. So, the answer is B.
• selected by
Answer:
Position:
Show:

Related questions

4 4 votes
1 answers 1 answer
1.0k
1.0k views
Bikram asked May 14, 2017
1,033 views
Assume that $a[4]$ is a one-dimensional array of $4$ elements, $p$ is a pointer variable and $p = a$ is performed. Now, which among these expressions is illegal?$p == a[0...
3 3 votes
2 answers 2 answers
1.7k
1.7k views
Bikram asked May 14, 2017
1,660 views
What is the output of the following program?#include <stdio.h void f(char ); int main() { char *argv[] = { "ab", "cd", "ef", "gh", "ij", "kl" }; f(argv); return 0; } void...
0 0 votes
1 answers 1 answer
549
549 views
Bikram asked May 14, 2017
549 views
Which of the following will print the value $2$ for this code snippet?#include<stdio.h int main() { int arr[10][20][30] = {0}; arr[5] = 2; __________ // missing line he...
0 0 votes
1 answers 1 answer
1.2k
1.2k views
Bikram asked May 14, 2017
1,236 views
Suppose the following declarations are in effect :$\text{int }a[ \: ] = \{5,15,34,54,14,2,52,72 \}$;$\text{int }*p = \&a , *q = \&a[5]$;The value of $q - p$ is ________...