Skip to content

Instantly share code, notes, and snippets.

@pavly-gerges
Forked from citrusui/dropdown.md
Last active December 9, 2022 11:08
Show Gist options
  • Save pavly-gerges/56514da70438a220dcb2a112db538bac to your computer and use it in GitHub Desktop.
Save pavly-gerges/56514da70438a220dcb2a112db538bac to your computer and use it in GitHub Desktop.
"Dropdowns" in Markdown
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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment