Can you please provide me the mistake of the program. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can you please provide me the mistake of the program.

#include <stdio.h> #include <conio.h> void main () { int i,n,f; printf("enter a number"); scanf("%d",&n); if(n>0) { f=1; for(i=n;i>=1;i--) { f=(f*i); } printf(" the factorial value=%d",f); } else { printf(" it is not a positive number"); } getch(); }

16th Sep 2020, 4:15 PM
Sandeep Devkota
Sandeep Devkota - avatar
1 Answer
+ 5
Sandeep Devkota The problem is sololearn doesn't support conio.h header file .That's why you cannot use getch.So delete the conio.h header file and getch() your program will work
16th Sep 2020, 4:26 PM
The future is now thanks to science
The future is now thanks to science - avatar