Welcome to AMIE Study - AMIE India Students Forum

AMIE Study - AMIE India Students Forum

collapse collapse

* Shoutbox

Refresh History
  • Sitigaurav: Section A note required
    January 13, 2019, 03:12:13 PM
  • Ulo3091: Please send doc file of project report someone
    December 29, 2018, 05:36:05 PM
  • Sujith Raj (AMIE - Civil): Any Idea, When will we get AMIE certificate & AM number
    December 20, 2018, 04:30:22 PM
  • Sujith Raj (AMIE - Civil): Congratulation to All those who cleared AMIE in recent result
    December 20, 2018, 04:29:40 PM
  • sulemangani: Can I reresisyered for section B exam as I have passed section A in winter 2008 but not appeared in some exams upto winter 2014
    December 12, 2018, 06:59:49 PM
  • I P Sarath Menon: Rcc , steel, advance structural analysis, design and analysis, soil, water hand written notes which was used to successfully complete AMIE [email protected]/9387774349
    November 28, 2018, 09:37:56 AM
  • I P Sarath Menon: Civil Engineering notes with optional structural with me
    November 28, 2018, 09:33:52 AM
  • ST694011-6: Hi everyone how to get RCC notes
    November 28, 2018, 09:17:25 AM
  • rekha1996: dbms
    November 27, 2018, 05:58:47 PM
  • rekha1996: Dbms
    November 27, 2018, 04:52:21 PM
  • Anwar VYM: Is AMIE degree acceptable in UAE?
    October 23, 2018, 10:16:46 PM
  • 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

* Search


* User Info

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

* Board Stats

  • stats Total Members: 48787
  • stats Total Posts: 27371
  • stats Total Topics: 6635
  • stats Total Categories: 6
  • stats Total Boards: 31
  • stats Most Online: 626

Author Topic: PROGRAM TO CALCULATE THE FACTORIAL OF A GIVEN NUMBER  (Read 1112 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
4470 Views
Last post November 28, 2011, 07:18:22 PM
by praveen
0 Replies
1829 Views
Last post September 22, 2011, 12:49:13 PM
by prayrona
0 Replies
852 Views
Last post September 06, 2012, 09:05:23 PM
by sainathan
0 Replies
885 Views
Last post September 15, 2012, 04:48:54 PM
by jitu_12341
2 Replies
3125 Views
Last post July 16, 2016, 09:10:31 AM
by SatishPatil
6 Replies
2152 Views
Last post September 28, 2014, 06:12:14 PM
by rahulm500
3 Replies
2898 Views
Last post November 09, 2016, 06:59:20 PM
by Saloni

* Search

* Subscribe to Forum

Enter your email address:

Advertisement

* Recent Posts

Solid Wood Dining Table Set Uk by alijhay
[January 15, 2019, 05:45:49 PM]


Re: Important!!! AMIE Exam fee revised from Rs 2000 to Rs 3000 by JessicaThisk
[January 09, 2019, 06:30:22 PM]


Re: Important!!! AMIE Exam fee revised from Rs 2000 to Rs 3000 by sulemangani
[December 12, 2018, 07:01:18 PM]


DiesqueLW by uncopy
[November 06, 2018, 08:47:00 PM]


Re: Supermembership queries by praveen
[November 04, 2018, 09:39:26 AM]