Tuesday, July 9, 2019

c interview questions 15

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

int main()
{
    int i=10,k;
    for(;;)
    {
        k=mult(i);
        if(--i<5)
            break;
    }
    printf("k=%d\n",k);
    return 0;
}
mult(int j)
{
    j*=j;
    return j;
}

output:
k=25

No comments:

Post a Comment

python class topic video