info@tutorialdiary.com

Saturday, May 21, 2016

Common Output Questions in AMCAT | Find the value

3:39 AM

Share it Please
Q.

function main()
{
static integer abc=5
print abc--
if(abc)
main()//calling main function
}
wat is output:

a)43210

b)54321

c)error 

d)infinite loop


Answer is b)

Run the following in c compiler:

[code]#include<stdio.h>

void main()
{
static int a=5;
printf("%d", a--);
if(a)
main();//calling main function
}[/code]

0 comments:

Post a Comment