Computer Science, asked by SubhanSait, 8 months ago

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 ROSHNIroshu
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