Monday, July 8, 2019

c interview question10

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

int main()
{
    int n=5;
    printf("%d\n",func(n));
    return 0;
}
func (int n)
{ return(n+sqr(n-2)+cube(n-3));}
sqr (int x)
{ return (x*x); }
cube(int x)
{ return (x*x*x);}


output::
22

No comments:

Post a Comment

python class topic video