int cap(int); main() { int n; n = cap(6); printf("%d",n); } int cap(int n) { if(n<=1) return 1; else return (cap(n-3)+cap(n-1)); }
Answers
Answer:
can't understand. ok
pls make me branist
Answer:
Concept:
C is a general-purpose computer programming language. The capabilities of the targeted CPUs are clearly reflected in C's features by design. It is widely used in computer architectures ranging from the largest supercomputers to the smallest microcontrollers and embedded systems, and has found long-term success in operating systems, device drivers, protocol stacks, and application software, though less so in recent years. Dennis Ritchie created C, a replacement for the programming language B, at Bell Labs between 1972 and 1973 in order to create tools that ran on Unix. The kernel of the Unix operating system was re-implemented using it. C increasingly gained popularity in the 1980s. Almost all current computer architectures & operating systems have access to C compilers, making it one of the most popular programming languages.
Given:
int cap(int); main() { int n; n = cap(6); printf("%d",n); } int cap(int n) { if(n<=1) return 1; else return (cap(n-3)+cap(n-1)); }
Find:
find the output for the given program
Answer:
The answer is 9
int cap(int);
main()
{
int n;
n = cap(6);
printf("%d",n);
}
int cap(int n)
{
if(n<=1)
return 1;
else
return
(cap(n-3)+cap(n-1));
}
As opposed to defining distinct variables for each value, arrays are used to hold numerous values in a single variable. Set the data type (such as int) and the array name, followed by square brackets [, to construct an array. Use a comma-separated list enclosed in curly brackets to add values to it. Use the element's index number to get to it in an array. The initial element of an array is [0] and array indexes begin at 0.
The next element is [1], etc. A variable that can hold numerous values is called an array. You could make an array for it, for instance, if you wanted to store 100 integers. An array is a type of data structure that can hold a fixed-size consecutive collection of elements of the same type. Its data value is [int data[100]].
The output is 9
#SPJ3