Monday, July 8, 2019

c interview questions3

#include <stdio.h>
#include <stdlib.h>

void func(int a,int b);
void main( )
{
    int x;
    x=func(2,3);
}
void func(int a,int b)
{
    int s;
    s=a+b;
    return;
}

output:
error: void value not ignored as it ought to be


explanation: void functions cant gives the return values .so in main "func" is  returning the value that will gives the error

No comments:

Post a Comment

python class topic video