Answer:
3.85 out of 4
Explanation:
As 96.1791 out of 100 gives 96.1791% calculated below:
Percentage formula: (Obtained value/total value)*100.......eq(1)
Putting values:
= (96.1791/100)*100
= 96.1791%
Now finding 96.1791% of 4:
Putting values in eq (1):
96.1791% = (Obtained value/4)*100
96.1791/100= (Obtained value/4) (dividing by 100 on both sides)
0.961791 = (Obtained value/4)
4* 0.961791 = Obtained value (multiplying 4 on both sides)
3.847164 = Obtained value
Then 96.1791% of 4 will be equal to: 0.961791 * 4 = 3.847164
Rounding off the answer to 2 decimal places:
=3.85 (As the digit on 3rd decimal place is greater than 5)
Answer:
Since the question expect us to declare a C-string, the solution code is written in C as follows:
- char ssn[9];
- scanf("%s",ssn);
Explanation:
A C-String is a string written in C language. It is an array of characters. To declare a C-string, we use the keyword, <em>char </em>and then followed with the variable name + brackets and the number of characters in the string. For example, we can create a C-String for the SSN number as in Line 1.
To read standard input into the array, we can use C built-in function, <em>scanf(). </em>Just include a string placeholder, %s, and the variable<em> ssn </em>as arguments to <em>scanf()</em>. This will assign the string input by user to variable <em>ssn</em> as C-String.
Answer:
#include <stdio.h>
int fib(int n) {
if (n <= 0) {
return 0;
}
if (n <= 2) {
return 1;
}
return fib(n-1) + fib(n-2);
}
int main(void) {
for(int nr=0; nr<=20; nr++)
printf("Fibonacci %d is %d\n", nr, fib(nr) );
return 0;
}
Explanation:
The code is a literal translation of the definition using a recursive function.
The recursive function is not per se a very efficient one.
It is actually podcast! i took the quiz as well :)