Write a C Program to find factorial of any number using goto statement

#include <stdio.h>
/* Program to find factorial of any number
using goto statement. */
void main()
{
// 5 * 4 * 3 * 2 * 1 = 120
int fact=1,x=7,y;
y=x;
repeat:
//fact = fact * x;
//x = x – 1;
fact *= x–;
if(x>1) goto repeat;
printf(“Factorial of %d is : %d”,y,fact);
}

 

For Life time valid video tutorials of “C Programming For Beginners” course with quiz and certification : Click Here

Downloadable video tutorials of “C Programming For Beginners” for TTRC Player : Click Here

My Self Subrat Dash. I have completed my MSc in Information Technology. Since last 12 years i am teaching Math and Computer at TTRC Computer Institute situated at Rayagada, Odisha, India. I believe in conceptual learning, so i explain each and every concept with demos and examples, which makes it easier to understand.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

error: Content is protected !!