answersLogoWhite

0

#include<stdio.h>

int main()

{

int a,b,c,d;

for(a=1; a<5; a++)

{

for(b=1; b<5; b++)

{

for(c=1; c<5; c++)

{

for(d=1; d<5; d++)

{

if(!(a==b a==c a==d b==c b==d c==d))

printf("dd\n",a,b,c,d);

}

}

}

}

return 0;

}

User Avatar

Wiki User

13y ago

Still curious? Ask our experts.

Chat with our AI personalities

JudyJudy
Simplicity is my specialty.
Chat with Judy
CoachCoach
Success isn't just about winning—it's about vision, patience, and playing the long game.
Chat with Coach
FranFran
I've made my fair share of mistakes, and if I can help you avoid a few, I'd sure like to try.
Chat with Fran
More answers

#include<stdio.h>

int main()

{

int a,b,c,d;

for(a=1; a<5; a++)

{

for(b=1; b<5; b++)

{

for(c=1; c<5; c++)

{

for(d=1; d<5; d++)

{

if(!(a==b a==c a==d b==c b==d c==d))

printf("dd\n",a,b,c,d);

}

}

}

}

return 0;

}

User Avatar

Priya Muthu

Lvl 2
7mo ago
User Avatar

Add your answer:

Earn +20 pts
Q: C program to print all combinations of a 4-digit number?
Write your answer...
Submit
Still have questions?
magnify glass
imp