2a Write Portion Computer Program Language Generate Print Six Lowercase Letter Passwords S Q37024758

2a. Write a portion of a computer program (in any language) thatwill generate and print all six lowercase letter passwords. Showyour code.

b. How many passwords does this generate?


Answer


class Solution

{

    public static voidmain(String[]args)

    {

        inta, b, c,d, e, f;

       

        // store the no ofpasswords generated

        int count= 0;

       

        // for firstletter

       for( a = 97; a <= 122 ;a++ )

       {

           // for second letter

           for( b = 97; b <= 122 ;b++ )

           {

               // for third letter

               for( c = 97; c <= 122 ;c++ )

               {

                   // for fourth letter

                  for( d = 97; d <= 122 ;d++ )

                   {

                       // for fifth letter

                       for( e = 97; e

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.