From cd3c3f6c9a79062b1b57046e94fff1e864c7f173 Mon Sep 17 00:00:00 2001 From: Manish Bhurtel <120724317+manishbhurtel11@users.noreply.github.com> Date: Sat, 18 Mar 2023 20:37:18 +0545 Subject: [PATCH] ok --- Basic Questions/q10.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Basic Questions/q10.c diff --git a/Basic Questions/q10.c b/Basic Questions/q10.c new file mode 100644 index 0000000..c35725b --- /dev/null +++ b/Basic Questions/q10.c @@ -0,0 +1,17 @@ +#include + +int main() { + int n, i; + int product = 1; + + printf("Enter a positive integer n: "); + scanf("%d", &n); + + for (i = 1; i <= n; ++i) { + product *= i; + } + + printf("The product of the first %d natural numbers is %d.", n, product); + + return 0; +} \ No newline at end of file