Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions C/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
| Program-44 | Program for implementation of the approach |
| Program-45 | Program to illustrate the above given pattern of numbers. |
| Program-46 | Program to convert binary number to decimal |
| Program-47 | Program to generate strong password |



33 changes: 33 additions & 0 deletions C/program-47/program 47.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#include <time.h>
#include <stdio.h>
#include <stdlib.h>

int main()
{
/* Length of the password */
int length;
int num;
int temp;
printf("Enter the length of the password: ");
scanf("%d", &length);
printf("\nEnter the number of passwords you want: ");
scanf("%d", &num);
/* Seed number for rand() */
srand((unsigned int) time(0) + getpid());

while(num--)
{
temp = length;
printf("\n");
while(temp--) {
putchar(rand() % 56 + 65);
srand(rand());
}

temp = length;
}

printf("\n");

return EXIT_SUCCESS;
}
9 changes: 9 additions & 0 deletions Python/program-4/Program 4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Store input numbers
num1 = input('Enter first number: ')
num2 = input('Enter second number: ')

# Add two numbers
sum = float(num1) + float(num2)

# Display the sum
print('The sum of {0} and {1} is {2}'.format(num1, num2, sum))