Monday, July 8, 2019

c interview question9

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

int main()
{
    int varl=12, var2=35;
    printf("%d",max(varl,var2));
    return 0;
}



int max (int x, int y)
{
    x>y? return x: return y;
}

output::
Error: Expression syntax
The operands of conditional operator should be expressions, but return x and return y are not
expressions.

No comments:

Post a Comment

python class topic video