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(); }
1 Resposta
+ 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