How do I dropdown?
This is how you dropdown.
<details> <summary>How do I dropdown?</summary> <br> This is how you dropdown. </details>
Want to ruin the surprise?
Well, you asked for it!
<details open> <summary>Want to ruin the surprise?</summary> <br> Well, you asked for it! </details>
Answer
/**
* @brief: A program to evaluate the summation equation Σ (1 / i); where i = [1, n] and (n) is the limit.
* @author: mina_maher
* @refactor: pavl_g
* @copyright: GDSC-Sohag
*/
#include<stdio.h>
int main() {
/* clear the standard output file */
setbuf(stdout,NULL);
/* declare and define variables for the equation */
int number = 0;
float sum = 0;
/* Create an endless state of user-inputs */
for (;;) {
printf("Enter number n : ");
scanf("%d", &number);
for (int i = 1; i <= number; i++) {
sum += (1.0 / i);
printf("%d %f \n", i, sum);
}
sum = 0;
}
return 0;
}