Welcome to AMIE Study - AMIE India Students Forum

AMIE Study - AMIE India Students Forum

collapse collapse

* Shoutbox

Refresh History
  • Vickytrips: Hii everyone....plz suggest book regarding design of electronics devices and circuit and electronics circuit
    May 16, 2018, 05:48:52 PM
  • vikas2eg: For AMIE Sec-A&B handwritten study material contact - [email protected] or [email protected] 8349801101
    May 02, 2018, 09:46:13 PM
  • mf1482: I need Mining Engineering MN 413 Old question papers. Can anybody Provide?  sunil  9414245175
    May 01, 2018, 09:35:03 PM
  • manirock87: HI RAAHUL.YG, FOR ANY STREAM, PROJECT AND LAB IS COMPULSORY FOR SECTION BIS
    April 28, 2018, 09:07:02 PM
  • manirock87: HI ANKI22 NO ONE ELSE CAN HELP. U NEED TO SEND MAIL TO [email protected] AND CALL AT 03340155400
    April 28, 2018, 09:05:47 PM
  • anki22: can any one  help.?. what is mean of login here ..if no one can help
    April 13, 2018, 11:48:34 PM
  • raahul.yg: Section B MECHANICAL project
    April 12, 2018, 02:11:42 PM
  • raahul.yg: Hi I want to know for section B project is compulsoury,I want to know practical is compulsuory
    April 10, 2018, 06:52:20 PM
  • anki22: please help i am not getting what should i do..i already cleared all sub of sec B ..i submit project and lab result to iei but my result is not showing on website...i mail to iei they said your project marks not submited by your project guide pls say to your project guide send by mail as soon as possible for declare result ...they submitted but still my result not showing ..and i mail to iei but they are not replying of my mail...pls guide me
    April 06, 2018, 12:03:50 PM
  • anki22: dear sir /mam
    April 06, 2018, 12:00:08 PM
  • praveen: Congrats.
    March 28, 2018, 08:48:26 AM
  • manirock87: Hi everyone With God's grace i passed AMIE completely. Thanks a lot to amiekeka for guiding me . Thanks all members and admin of amiestudy. Thanks once again.
    March 24, 2018, 04:31:03 PM
  • indhuhcl: When will winter 2017 results declare
    March 23, 2018, 06:47:41 AM
  • thannara123: it will april
    March 19, 2018, 06:22:42 PM
  • thannara123: hi
    March 19, 2018, 06:22:32 PM
  • ashish_waghumbare: Did anybody have any idea, when the Winter 2017 result will be declare?
    March 19, 2018, 08:26:49 AM
  • parthiban1189: hi anybody have CV412-DESIGN OF RCC & CONCRETE STRUCTURES full set of question papers
    February 28, 2018, 01:38:29 PM
  • kirannm: hii
    February 18, 2018, 03:39:53 PM
  • GCPATIL: Can I reregistration of section A done by online procedure
    January 30, 2018, 06:45:08 PM
  • girish_amie: Please upload electrical engineering latest question paper
    December 06, 2017, 09:25:40 AM

* Search


* User Info

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

* Board Stats

  • stats Total Members: 48592
  • stats Total Posts: 27322
  • stats Total Topics: 6602
  • stats Total Categories: 6
  • stats Total Boards: 31
  • stats Most Online: 626

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

* Search

* Subscribe to Forum

Enter your email address:

Advertisement

* Recent Posts

Re: Required Old Question Paper (Subject Code_EL414) by amitsngh23
[May 22, 2018, 10:19:59 PM]


Re: Power System Performance (EL 414) Study Material by amitsngh23
[May 12, 2018, 01:03:49 AM]


Re: how to join AMIE by nuruthin
[May 08, 2018, 12:33:16 AM]


Re: making whatsapp group by nuruthin
[May 08, 2018, 12:30:52 AM]


Attestation by IEI member in Bangalore by manig
[May 05, 2018, 01:03:58 PM]