please make a factorial number that the output is like this:

Enter a number:5

5!=1*2*3*4*5
5!=120

likewise

Enter a number:6
6!=1*2*3*4*5*6
6!=720

please..help.

using for loop statement only.

please do not use #include<iostream.h>...

use this
example:
#include <stdio.h>
#include <conio.h>
........etc.

please...help me...

please make a factorial number that the output is like this:

Enter a number:5

5!=1*2*3*4*5
5!=120

likewise

Enter a number:6
6!=1*2*3*4*5*6
6!=720

please..help.

using for loop statement only.

please do not use #include<iostream.h>...

use this
example:
#include <stdio.h>
#include <conio.h>
........etc.

please...help me...

#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,f;
clrscr();
f=1;
printf("enter no");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
f=f*i;
}
printf("fac=%d",f);
getch();
}

Edited 6 Years Ago by __avd: Added [code] tags. For easy readability, always wrap programming code within posts in [code] (code blocks).

Comments
1st- you didn't read any of the rules. 2nd-You didn't read the previous post. 3rd-We DO NOT give away code. 4th-Format your code
Don't post complete solutions to homework problems.

here what you want.
the code is developed with tc++ ver.3.0

#include<stdio.h>
#include<conio.h>
void main()
{
	clrscr();

	int i,j,n,d,k;
	printf( "\n Enter the no.:  " );
	scanf( "%d",&n );
	printf( "\n\n %d! = ",n );

	for( i = 0,k = j = n; i < 5; i++ )
	{
		if( k == 1 )
			printf( "%d ", k );
		else
			printf( "%d * ", k );

		k = k - 1;

		if( k > 0 )
			n = n * k;

	}

	printf( "\n\n %d! = %d",j,n );

	getch();
}

i think it solves your problem. Have a good day!

Comments
Not only that but the code is non-standard and not worthy of teaching.
Don't post complete solutions to homework problems. Did you not read the post immediately above this one??

please make a factorial number that the output is like this:

Enter a number:5

5!=1*2*3*4*5
5!=120

likewise

Enter a number:6
6!=1*2*3*4*5*6
6!=720

please..help.

using for loop statement only.

please do not use #include<iostream.h>...

use this
example:
#include <stdio.h>
#include <conio.h>
........etc.

please...help me...

#include<stdio.h>#include<conio.h>void main(){int i,n,f;clrscr();f=1;printf("enter no");scanf("%d",&n);for(i=1;i<=n;i++){f=f*i;}printf("fac=%d",f);getch();}#include<stdio.h>
#include<conio.h>
void main()
{
int i,n,f;
clrscr();
f=1;
printf("enter no");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
f=f*i;
}
printf("fac=%d",f);
getch();
}

Edited 3 Years Ago by mike_2000_17: Fixed formatting

Comments
This is even worse code than the previous poster. It uses the same bad techniques and adds even more.
OMG that's worse than your first post.

@micjan : Congrats you got the code !!! I certainly wish the two smart people above get you everything you want in your life ... because with this attitude you are not gonna learn or earn anything...!!!

Edited 6 Years Ago by csurfer: n/a

Comments
I like it!

@micjan : Congrats you got the code !!! I certainly wish the two smart people above get you everything you want in your life

Especially since both of them answered with terrible non-standard code, which makes the code dangerous to people's understanding of good code practices. Please ignore the code given.

Comments
They were horrid excuses for programs weren't they :)

please make a factorial number that the output is like this:

Enter a number:5

5!=1*2*3*4*5
5!=120

likewise

Enter a number:6
6!=1*2*3*4*5*6
6!=720

please..help.

using for loop statement only.

please do not use #include<iostream.h>...

use this
example:
#include <stdio.h>
#include <conio.h>
........etc.

please...help me...

#include<stdio.h>
main()
{
int a, fact;
printf("\nEnter any number: ");
scanf ("%d", &a);
fact=rec (a);
printf("\nFactorial Value = %d", fact);
}

rec (int x)
{
int f;
if (x==1)
return (1);
else
f=x*rec(x-1);
return (f);
}
Comments
Why didn't you read the previous code posts? We DO NOT give away code. And format your code

You can ignore that code also. Be sure you write your own code micjan and don't even bother with code that has no formatting, improper function definitions, bad headers, etc.

And to rajendra.parmar, skwatamkar, and abc@ -- please refrain from doing other people's homework for them. They learn nothing, and you are posting code that will probably not get an A because of the above.

This article has been dead for over six months. Start a new discussion instead.