Home » NO IDEA » Combination of all Four digit Number

Combination of all Four digit Number

Blog Stats

  • 13,912 hits
December 2013
M T W T F S S
« Oct   Jan »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

// Write a C program to print all combinations of a 4-digit number

#include<stdio.h>
int main()
{
	int i,j,k,l,count=0;
	for(i=0;i<=9;i++)
	for(j=0;j<=9;j++)
	for(k=0;k<=9;k++)
	for(l=0;l<=9;l++)
	{
		printf("%d%d%d%d\n",i,j,k,l);
		count++;
	}
	printf("\n The total combination %d",cou
	return 0;
}
OUTPUT
 combination
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: