Computer Science, asked by suvosarkar3413, 3 months ago

write a program to accept a sentence containing two sentences only. the sentence may be terminated by either "." "?" or "!". any other character may be ignored. the word may be separated by only one single blank and to be in upper case. separate the paragraph in two sentences find common words and frequency of common words with any example

Answers

Answered by mahesijjh
0

In c language, I wrote this program,

#include<stdio.h>

#include<conio.h>

void main()

{

clrscr();

printf("Hey!");

printf("How are you?");

printf ("okay bye.");

getch();

}

Answered by TheArkhamKnight
0

Answer:

const text = document.querySelector('input[type=text]');

      function count_duplicate(a){

           let counts = {}

           for(let i =0; i < a.length; i++){  

               if (counts[a[i]]){

               counts[a[i]] += 1

               } else {

               counts[a[i]] = 1

               }

               }  

               for (let prop in counts){

                   if (counts[prop] >= 2){

                       console.log("'" + prop + "'" + " counted: " + counts[prop] + " times.")

                   }

               }

           }

       function findDuplicates() {

           textcontent = text.value;

           fullstop = '.';

           textcontentarray = textcontent.toLowerCase().replaceAll('.', '').split(' ');

           console.log(count_duplicate(textcontentarray));

       }

You'll have to check js console and use html input text, but this should work. Have a nice day!

Similar questions