Welcome to AMIE Study - AMIE India Students Forum

AMIE Study - AMIE India Students Forum

collapse collapse

* Shoutbox

Refresh History
  • vae: hi
    May 19, 2019, 03:21:54 PM
  • raviteja2412: I need mining engineering previous years question paper can anyone help me
    May 13, 2019, 06:20:39 PM
  • vae: Good afternoon every1
    May 09, 2019, 01:14:34 PM
  • vae: IMNA : EXCELLENT TUITIONS  136, First Floor, Above Raghavendra Enterprises, Coconut Avenue, 8th Cross, Malleswaram, Bangalore 560 003, India.  Phone: +91 9844027371
    May 02, 2019, 05:13:30 PM
  • vae: hellooooooooooooooooooooo
    May 02, 2019, 12:36:53 PM
  • vae: Shantanu09 - You can get the full notes if  U follow the link : [link]
    May 01, 2019, 12:44:07 PM
  • vae: Dear Shahul, kindly follow the link : [link] where you can get all details
    May 01, 2019, 12:42:37 PM
  • shantanu09: HLW everyone, can anyone send me notes for material scienece
    April 30, 2019, 05:43:38 PM
  • shahul: Any one can guide me, to join new membership ST (Diploma stream) by online???
    April 30, 2019, 04:30:47 PM
  • shahul: Good evening
    April 30, 2019, 04:29:18 PM
  • vae: Hi
    April 29, 2019, 12:42:11 PM
  • imna: i am looking for coaching class in Bangalore. Please I need guidance
    April 28, 2019, 09:42:40 AM
  • imna: hello anyone from bangalore?
    April 28, 2019, 09:37:41 AM
  • T-1700565: Please send AN 205 and AN 210 NOTES
    April 25, 2019, 10:06:09 PM
  • vae: Good Afternoon Everyone
    April 25, 2019, 10:36:29 AM
  • vae: Happy Easter Every1
    April 21, 2019, 12:53:46 PM
  • RK Electrical: Can anyone send me the fundamentals of design and manufacturing pdf book link?
    April 16, 2019, 10:29:00 PM
  • vae: Happy Vishu...Everyone
    April 15, 2019, 11:30:44 AM
  • vae: hello
    April 14, 2019, 12:45:51 PM
  • SUJEET KUMAR MISHRA: Good afternoon sir, mujhe sec-a, material science ka  notes  chahiye sir
    April 13, 2019, 10:40:49 AM

* Search


* User Info

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

* Board Stats

  • stats Total Members: 48882
  • stats Total Posts: 27507
  • stats Total Topics: 6656
  • stats Total Categories: 6
  • stats Total Boards: 31
  • stats Most Online: 626

Author Topic: C++ program of Factorial  (Read 1545 times)

Description:
April 22, 2009, 08:42:15 AM
  • Super Member
  • Registered User
  • *
  • Posts: 9
    • View Profile
Advertisement
#include<iostream.h>
     #include<conio.h>

   void main()
    {
   int j,no;
   int factorial(int);  //initinalize the function
   //   cout<<" --<<ENTER THE NUMBER>>--";
     //   cin>>no;
   for(j=0;j<no;j++)
   cout<<"n"<<"THE FACTORIAL OF:-"<<j<<"="<<factorial(j);
    }
   factorial(j)

     {
     int n;
     n=j;
     int fact;
     if(n==0)
     return 1;
      else
      {
      fact=n*factorial(n-1); //the  last factorial is multiple with the number
      return fact; //return value.
      }

    }
« Last Edit: January 01, 1970, 04:00:00 AM by Guest »


April 22, 2009, 11:16:50 AM
Reply #1
  • Administrator
  • Senior Member
  • *****
  • Posts: 2173
  • Luck is for lazies, success is for who work hard
    • View Profile
    • AMIE Online Coaching
Thanks for the program..
« Last Edit: January 01, 1970, 04:00:00 AM by Guest »
Praveen
AMIE Study
April 13, 2010, 04:35:57 AM
Reply #2
  • Super Member
  • Senior Member
  • **
  • Posts: 107
    • View Profile
Hello.

I have one doubt...
I study c++ by video and compiled also on Dec c++ compiler.
# include <iostream> /* THIS IS I learned by video and complier accept this*/
but I saw in your program #include <iostream.h>

Please clearify....
Thanks
« 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 13, 2010, 01:11:23 PM
Reply #3
  • phpBB Moderator
  • Senior Member
  • **
  • Posts: 877
    • View Profile
as far as i studied #include <iostream.h>  is correct. u have to add .h (header).
« Last Edit: January 01, 1970, 04:00:00 AM by Guest »
Regards,
Charulatha.
April 14, 2010, 11:06:13 AM
Reply #4
  • Super Member
  • Senior Member
  • **
  • Posts: 107
    • View Profile
Hello.
I c its require, like #include <stdio.h>

when I compiled putting .h also then compiler says its wrong.
If you give me your email address, I will send come video tutorial also.

Regards
Irfan
[email protected]
« 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 16, 2010, 04:41:58 PM
Reply #5
  • phpBB Moderator
  • Registered User
  • *
  • Posts: 56
    • View Profile
    • http://sites.google.com/a/daffodildb.com/study/Home
Hello C++ fans,

           I have observed that when using #include<iostream.h> , using namespace std; is not required.
(Namespaces are used to avoid multiple symbol definitions when using several libraries.you already know.)
Code: [Select]
<iostream> is the standard header
Code: [Select]
<iostream.h> is the old standard header, not longer supported by some compilers

but remember you can't write conio in place of 'conio.h' like iostream.
Quote
A frequent piece of advice is often given to new C++ programmers is to use <iostream> instead of <iostream.h> or <fstream> instead of <fstream.h> [according to you compiler version]
Here is a link I found that gives some background on why there are two versions of iostream headers. You could probably find a lot of articles on the subject using a search engine. I searched on "iostream vs. iostream.h".
http://http://members.gamedev.net/sicrane/articles/iostream.html
hope its clear you doubt.
« Last Edit: January 01, 1970, 04:00:00 AM by Guest »
Thanks
Rohit Wadhwa
Site : Study Site
April 17, 2010, 10:49:52 AM
Reply #6
  • Super Member
  • Senior Member
  • **
  • Posts: 107
    • View Profile
Thank you Mr. Rohit.
You are always helpfull.
« 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]
March 23, 2011, 04:00:36 PM
Reply #7
  • Registered User
  • *
  • Posts: 20
    • View Profile
Thank you...Useful discussion...

Regards
Ramji
« Last Edit: January 01, 1970, 04:00:00 AM by Guest »
Regards
Ramji R
 

Related Topics

  Subject / Started by Replies Last post
0 Replies
692 Views
Last post February 22, 2009, 05:58:07 PM
by praveen
6 Replies
2227 Views
Last post August 19, 2012, 07:08:45 PM
by simha_reddy
0 Replies
636 Views
Last post March 18, 2009, 02:12:47 PM
by rohit.wadhwa
3 Replies
1175 Views
Last post March 23, 2011, 04:07:44 PM
by ram1ramji
0 Replies
701 Views
Last post March 18, 2009, 03:48:16 PM
by rohit.wadhwa
5 Replies
1274 Views
Last post March 19, 2009, 01:14:51 PM
by skyblue
1 Replies
1159 Views
Last post June 25, 2012, 05:54:55 PM
by Sudheeshk

* Search

* Subscribe to Forum

Enter your email address:

Advertisement

* Recent Posts

Solid Wood Dining Table Set Uk by arafats
[May 24, 2019, 05:35:06 PM]


Re: All About AMIE by vae
[May 09, 2019, 04:40:15 PM]


Re: All About AMIE by vae
[May 09, 2019, 04:26:26 PM]


Re: All About AMIE by vae
[May 09, 2019, 01:12:24 PM]


Re: All About AMIE by vae
[May 09, 2019, 01:03:32 PM]