Welcome to AMIE Study - AMIE India Students Forum

AMIE Study - AMIE India Students Forum

collapse collapse

* Shoutbox

Refresh History
  • devjangde: Dear Sir/Madam please me out for my membership Number and  reference number.  I lost both of this . Is there any way to find out?
    October 08, 2018, 09:32:50 AM
  • devjangde: Dear Sir/Madam,
    October 08, 2018, 09:30:46 AM
  • Srijib: Can someone have any notes for the subject society and environment
    October 07, 2018, 07:37:52 PM
  • muleredd: can someone have previous year question papers for Sec B Mining Engineering ?
    October 07, 2018, 01:52:05 PM
  • Pahadi57: Will I send the printed copy of the winter application form after online form filling successfully.... Pls advice
    October 05, 2018, 05:54:03 PM
  • SANUKARMAKAR1: Section A society and environment and computing and informatics not required .
    October 04, 2018, 03:19:43 PM
  • pravendrapmmb: Where to get books for section B Electrical Engineering
    October 02, 2018, 10:23:23 PM
  • rodricksarthur: Sum 2018 results, Mining Engineering Sec B, MN435 result is not declared. Any one of you, know why?
    September 28, 2018, 08:59:53 AM
  • divakara.sd: Dear sir/Madam I am Divakar, Study under IEI in M and M branch. Recently I am registered for section B I quired the study notes and Questions papares for fallowing subject.  IC402- ENGINEERING MANAGEMENT MM403- METALLURGICAL THERMODYANAMIC AND KENETICS MM404-EXTRACTIVE METALLURGY MM405-MECHANICAL BEHAVIOUR OF MATERIALS MM406-PHYSICAL METALLURGY MM407-METALLURGICAL DESIGN MM432-WELDING AND ALLIED PROCESS MM433-ADVANCED PHYSICAL METALLURGY MM434-FOUNDRY ENGINEERING   Thanks and regards Mr.Divakar State-Karnataka District-Bellary Place-Emmiganure Pin code-538113 Phone number-9743956204
    September 24, 2018, 11:48:09 PM
  • Anu Mangalore: Section b mechanical notes required
    September 21, 2018, 09:37:37 PM
  • AjeetIOCL: can u tell me ,my AMIE registration is of 2010 which has expired in 2016 ,I have Re-registered again in 2018 by re-registration process .is my date of election will be changed or remain same.is this degree of AMIE will be Valid? because Supreme Court has decided not to consider AMIE degree after May 2013
    September 20, 2018, 08:59:06 PM
  • jooly: is data structure in CS is tough?do we need to learn C program thouroughly for it?
    September 11, 2018, 09:33:03 AM
  • Manish100ni: I got AAAD grade in section A , i am pass or fail ??
    August 19, 2018, 05:02:34 AM
  • [email protected]: Can anyone tell if Saudi Engineers Council accept  AMiE or not?
    July 18, 2018, 11:38:24 AM
  • Khadeejath Shamna: Can we send section b registration form and examination form together?  When can we register for section b winter exam 2018?
    July 09, 2018, 03:46:15 PM
  • GCPATIL: How to change mobile number and email address
    July 09, 2018, 01:33:10 AM
  • Sanoj.kaushik: Hi everyone, It is informed that civil lab experiments at Manav Rachna Institute would be started in mid july. So, kindly informed to other friends.
    June 15, 2018, 05:33:15 PM
  • ramajit: yes. i also need help for project work. any format or ref available. pls send me email [email protected]
    June 12, 2018, 10:22:21 AM
  • JYOTI VERMA: mail me on [email protected]
    June 10, 2018, 09:33:12 PM
  • JYOTI VERMA: i wqnt to know about mechanical project work topiics.please send me it on my mail if any one have
    June 10, 2018, 09:32:34 PM

* Search


* User Info

 
 
Welcome, Guest. Please login or register.
Did you miss your activation email?

* Board Stats

  • stats Total Members: 48702
  • stats Total Posts: 27337
  • stats Total Topics: 6606
  • stats Total Categories: 6
  • stats Total Boards: 31
  • stats Most Online: 626

Author Topic: PROGRAM TO CALCULATE THE FACTORIAL OF A GIVEN NUMBER  (Read 1064 times)

Description:
March 18, 2009, 03:08:05 PM
  • phpBB Moderator
  • Registered User
  • *
  • Posts: 56
    • View Profile
    • http://sites.google.com/a/daffodildb.com/study/Home
Advertisement
Code: [Select]
 /* PROGRAM TO CALCULATE THE FACTORIAL OF A GIVEN NUMBER */
  /*author-Rohit Wadhwa*/
   #include<stdio.h>
   #include<conio.h>
   void  main()
    {
    int n;
    int fact=1;
    int val;
    printf("Enter a number for Calculate Factorial:n");
    scanf("%d",&n);
    val=n;
    while(n>1)
    {
    fact*=n;/*fact=fact*n*/
    n--;
    }
    printf("Factorial of %d are: %dn",val,fact);
    getch();
    }
« Last Edit: January 01, 1970, 04:00:00 AM by Guest »


Thanks
Rohit Wadhwa
Site : Study Site
April 14, 2010, 04:39:05 AM
Reply #1
  • Super Member
  • Senior Member
  • **
  • Posts: 107
    • View Profile
Hello Mr. Rohit,
Thanks for the program, but I have some comments after execution.
This program is not calculating correct answer after 10 because value is getting hence I use "double" variable instead of int for factorial.
Find below my program in C++ , I appreciate comments....

/* Program to fing Factorial number*/

#include <iostream>
#include <cmath>
int main ()
{
    int n; /* n= Given number for which we want factorial */
    double f=1; /* f= factorial number */
    using namespace std;
    cout << "Please Enter the Number for which you want Factorial ??  " << endl;
    cin >> n;
     while (n!=0)
    {
    f=f*n;
    n=n-1;}  
    cout << "Factorial is     "<< f << endl;  
    system ("pause");
    return 0;
    }
« Last Edit: January 01, 1970, 04:00:00 AM by Guest »
Thanks & Best Regards -
Irfan M Ansari  - Section B - Civil
Bhiwandi - Dist THANE // MAHARSHTRA
Email :[email protected]
IM: [email protected]
April 15, 2010, 09:56:53 AM
Reply #2
  • phpBB Moderator
  • Registered User
  • *
  • Posts: 56
    • View Profile
    • http://sites.google.com/a/daffodildb.com/study/Home
Hello Mr Irfanmasiullah,

        you r right,this program is only give right result up to 10.Nice work keep it up.
you can also used long type for factorial result.
« Last Edit: January 01, 1970, 04:00:00 AM by Guest »
Thanks
Rohit Wadhwa
Site : Study Site
March 23, 2011, 04:07:44 PM
Reply #3
  • Registered User
  • *
  • Posts: 20
    • View Profile
« Last Edit: January 01, 1970, 04:00:00 AM by Guest »
Regards
Ramji R
 

Related Topics

  Subject / Started by Replies Last post
1 Replies
4408 Views
Last post November 28, 2011, 07:18:22 PM
by praveen
0 Replies
1785 Views
Last post September 22, 2011, 12:49:13 PM
by prayrona
0 Replies
826 Views
Last post September 06, 2012, 09:05:23 PM
by sainathan
0 Replies
856 Views
Last post September 15, 2012, 04:48:54 PM
by jitu_12341
2 Replies
3030 Views
Last post July 16, 2016, 09:10:31 AM
by SatishPatil
6 Replies
2002 Views
Last post September 28, 2014, 06:12:14 PM
by rahulm500
3 Replies
2760 Views
Last post November 09, 2016, 06:59:20 PM
by Saloni

* Search

* Subscribe to Forum

Enter your email address:

Advertisement

* Recent Posts

Re: making whatsapp group by ganesan5450
[October 12, 2018, 02:40:35 PM]


Re: making whatsapp group by AJEEBHAMSA
[October 11, 2018, 12:58:09 PM]


Re: making whatsapp group by aditya_bhushan
[October 10, 2018, 07:18:40 PM]


Re: Mining Engineering by muleredd
[October 07, 2018, 02:16:55 PM]


Solid Wood Dining Table Set by bellianawil
[October 06, 2018, 05:18:26 PM]