Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  1
Language: C/C++
Code:

     #include<stdio.h>
//#include<conio.h>
int main(){
    int n,op,fact,i;
     scanf("Enter %d",&n);
    if(n<0)
    op=-1;
    else if(n>7)
    op=-2;
    else {
        for(i=1;i<=n;i++){
            fact=fact*i;
            printf("%d factorial is %d",n,fact);
            op=fact;
            
             }
         }
    printf("output is %d",op);
    return 0;
    }     
Comments: