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
What are linked lists in c?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
What does dm mean sexually?
The __________ attribute is used to announce variables based on definitions of columns in a table?
What is the best style for code layout in c?
Where are local variables stored in c?
In cryptography, you could often break the algorithm if you know what was the original (plain) text that was encoded into the current ciphertext. This is called the plain text attack. In this simple problem, we illustrate the plain text attack on a simple substitution cipher encryption, where you know each letter has been substituted with a different letter from the alphabet but you don’t know what that letter is. You are given the cipherText as the input string to the function getwordSets(). You know that a plain text "AMMUNITION" occurs somewhere in this cipher text. Now, you have to find out which sets of characters corresponds to the encrypted form of the "AMMUNITION". You can assume that the encryption follows simple substitution only. [Hint: You could use the pattern in the "AMMUNITION" like MM occurring twice together to identify this]
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
What is the use of a conditional inclusion statement in C?
Does c have an equivalent to pascals with statement?
Why is a semicolon (;) put at the end of every program statement?
How can I prevent another program from modifying part of a file that I am modifying?
What are the various types of control structures in programming?
Where static variables are stored in c?
Why isnt there a numbered, multi-level break statement to break out