Write the output of the following code:-
int cnt = 10;
for(int i =1, j = 1; i <= cnt ; i++,j++)
{
System.out.print(j+ "\t");
if(i%2 == 0)
{
j = i + 1;
System.out.println();
Answers
Answered by
0
Answer:
1
of 1 vote
int size;
void dig_gen(int m,int n, char* passwd)
{
int i,j;
if(n==size-1)
{
for(i=m;i<=9;i++)
{
passwd[n]='0'+i;
for(j=0; j<size; j++)
printf("%c",passwd[j]);
printf("\n");
}
}
else
{
for(i=m;i<10-size+n+1;i++)
{
passwd[n]='0'+i;
dig_gen(i+1,n+1,passwd);
}
}
}
void main()
{
char* passwd;
scanf("%d",&size);
passwd=malloc(sizeof(char)*size);
dig_gen(0,0,passwd);
free(passwd);
Similar questions
English,
4 months ago
Biology,
8 months ago
India Languages,
8 months ago
English,
11 months ago
Social Sciences,
11 months ago