Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is the output of the following progarm?



#include<stdio.h>

main( )

{

int x,y=10;

x=4;

y=fact(x);

printf(ā€œ%d\nā€,y);

}



unsigned int fact(int x)

{

return(x*fact(x-1));

}

A. 24

B. 10

C. 4

D. none

Answer Posted / venu

ans:D.
when x= 1, x-1 =0, so total value = 0;
in fact() they are not checking if x==1 && x==0.

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you please explain the difference between malloc() and calloc() function?

1103


What is the use of typedef in c?

1019


What does %d do?

1255


What are the different types of objects used in c?

1012


What is c value paradox explain?

1072


program to find out date after adding 31 days to a date in the month of febraury also consider the leap year

3070


All technical questions

1966


Explain what are header files and explain what are its uses in c programming?

1135


Explain how do you determine whether to use a stream function or a low-level function?

1067


Explain modulus operator.

1031


What are the advantages of union?

1059


write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);

2338


Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me

1939


what do you mean by inline function in C?

1044


Difference between pass by reference and pass by value?

1136