MSK Technologies

Home
Practice Programs
Java Programs Python Programs Java Quiz
Pages
Python Java Material PLSQL Material
Search A Job

Write a C-program to print factorial number using for loop?

  1. Home
  2. C Language Programs

Write a C-program to print factorial number using for loop?

Write a C-program to print factorial number using for loop


#include <stdio.h>
int main() {
    int x,n,fact=1;
    printf("Enter n value ");
    scanf("%d",&n);
    for(x=1;x<=n;x++)
    {
        fact=fact*x;
    }
    printf("%d Factorial is %d",n ,fact);
  
    return 0;
}

Output:

Enter n value 5
5 Factorial is 120

Enter n value 6
6 Factorial is 720




More Programs


46 . Write a C-program to print factorial number using for loop
47 . Write a C-program to print factorial of n numbers using for loop
48 . Write a C-program to print sum of natural numbers using for loop
49 . Write a C-program to print sum of even numbers using for loop
50 . Write a C-program to print sum of odd numbers using for loop
51 . Write a C-program to print sum of even or odd numbers based on the n value using for loop
52 . Write a C-program to print sum of even or odd numbers based on the n value using single loop
53 . Write a C-program to display table using for loop
54 . Write a C-program to print a to z
55 . Write a C-program to print ASCII values of a to z
56 . Write a C-program to print ASCII values of A to Z



Apply For The Job

Apply For Job

Java Material

Python Material

PLSQL Material

.Net Material

Java Practice Programs

400 Java Programs

Java Practice Programs

Write a Java program that takes five numbers as input to calculate and print the average of the numbers

Write a Java Program to Check if a Number is Positive, Negative or Zero.

Write a Java program to swap the first and last elements of an array and create a new array

Write a Java program to convert a binary number to decimal number

Write a Java program to accept a float value of number and return a rounded float value

Python Practice Programs

Write a Python program to find out what version of Python you are using.

Write a python program startswith and Endswith Methods

Write a Python program to count number of vowels in the given string

Write a Python program that accepts a sequence of comma-separated numbers from the user and generates a list and a tuple of those numbers.

Write a Python program to display the first and last colors from the following list.

Java Quiz

Java Quiz - 19

Java Quiz - 15

Java Quiz - 13

Java Quiz - 7

Java Quiz - 12

Courses
Java Python PLSQL .Net ADO.Net About Us
Quick Links
Daily Use English Sentences Daily General Knowledge General Knowledge Latest Update Inventions and Inventors జనరల్ నాలెడ్జ్ General Knowledge Spoken English Spoken Hindi GK Hindi Telugu Facts Unknown Facts Psychology Facts Motivation Quotes విటమిన్ - సి,డి,ఇ,కె Android
Spiritual
రాధాకృష్ణ భగవద్గీత Motivation Quotes Slokas Talapatra Nidhi ఆధ్యాత్మిక భక్తి ప్రపంచం Sadhguru Sai Motivation Quotes గౌతమ బుద్ధుడు Bhagavad Gita Quotes
Newsletter

Dolor amet sit justo amet elitr clita ipsum elitr est.

© sateeshm, All Right Reserved. Designed By sateeshm
Home Help FQAs