1
#include <stdio.h>
void main() {
int x=10;
int y;
int numero;
printf("quantos digitos tem sua senha: ");
scanf("%d", &numero);
y = numero * x;
printf("sua senha tem %d combinacoes possiveis!", y);
}
For now I have arrived at this, I need to make a program q the user put how many digits have his password and the program calculate the possible combinations based on as many digits q the user put.
Remembering that the password is composed only by numbers.
Example: the user puts the value 1, the program must say q there are 10 combinations (0,1,2,3,4,5,6,7,8,9).
And what is your doubt?
– Maniero
Your question is about combinations or how to apply the combinations in the code? If it is the second option, which part you are unable to apply?
– Ronaldo Araújo Alves
If the digits can be repeated in the password then you can have 10 x possibilities. If repetitions cannot occur then you can have 10! / (10-x)! possibilities (simple arrangement of mathematics).
– anonimo