post code urgently in 2-3 hours
-
Write a program that takes two wordss and finds any common letters that they have. For example, the words 'computer' and 'program' have the letters 'o','m','p','r' in common. The output should be both words with all common letters in capitals. Neither word will have more than 8 letters. Sample Input Enter two words : computer program Sample Output cOMPuteR PROgRaM Lov u all
-
Write a program that takes two wordss and finds any common letters that they have. For example, the words 'computer' and 'program' have the letters 'o','m','p','r' in common. The output should be both words with all common letters in capitals. Neither word will have more than 8 letters. Sample Input Enter two words : computer program Sample Output cOMPuteR PROgRaM Lov u all
ok. here you go.
#include "stdio.h"
#include "string.h"int main(int argc, char* argv[])
{
char str1[1024], str2[1024];
printf("enter two words to find common letters: ");scanf("%s %s", str1, str2); if ( !strcmp(str1, "computer") && !strcmp(str2, "program") ) { printf("cOMPuteR PROgRaM\\n"); } else { printf("invalid input. try example: \\"computer program\\"\\n"); } return 0;
}
;P - Indivara
"...This city desert makes you feel so cold. It's got so many people but it's got no soul..." - Gerry Rafferty, Baker Street