Answer the questions based on the program given below.
a) Write the function prototype of fnFunny function.
b) Write the output produced by the above program
#include <stdio.h>
int main (void){
unsigned short i =4;
unsigned long j = 6 ;
short k = 2 ;
k = fnFunny ( i , j );
printf("i = %hu, j = %lu, k = %hi\n", i, j, k);
return 0;
}
short fnFunny (unsigned short i, unsigned long j ){
short k = 0;
for( ; ; )
{
printf("i = %hu, j = %lu, k = %hi\n", i, j, k);
if (--i == 3 ) continue;
k += i ;
if (j++ == 6) break;
}
return k;
}
a) the function prototype of fnFunny function. short fnFunny (unsigned short, unsigned long); b) #include <stdio.h> short fnFunny (unsigned short, unsigned long); int main (void){ unsigned short i =4; unsigned long j = 6 ; short k = 2 ; k = fnFunny ( i , j ); printf("i = %hu, j = %lu, k = %hi\n", i, j, k); return 0; } short fnFunny (unsigned short i, unsigned long j ){ short k = 0; for( ; ; ) { printf("i = %hu, j = %lu, k = %hi\n", i, j, k); if (--i == 3 ) continue; k += i ; if (j++ == 6) break; } return k; } the output produced by the above program is
i = 4, j = 6, k = 0
i = 3, j = 6, k = 0
i = 4, j = 6, k = 2
Get Answers For Free
Most questions answered within 1 hours.