Posts

Showing posts from November, 2021

Letter Identification

Question-> (Letter Identification) Given three words, write an algorithm and the subsequent C++ code to identify the following letters:   1.Letters Common To All The Three Words. 2.Letters In First Two Words But Not In The Third Word. 3.Letters In First Word But Not In Second And Third Word. 4.Letters In All The Three Words.   FOR EXAMPLE-If The Words Are Apple, Camel, Element Then L 1.Letters Common To All The Three Words-   l, e 2.Letters In First Two Words But Not In The Third Word- a 3.Letters In First Word But Not In Second And Third Word- p 4.Letters In All The Three Words- a, p, l, e, c, m, n, t;   CODE: #include <iostream> #include <cstring> using namespace std ; int main () {     string st1 ;     cin >> st1 ;     string st2 ;     cin >> st2 ;     string st3 ;     cin >> st3 ;     int count = 0 ;     // case1: ...

NOTES

Image
  " #include<iostream>"  - this text is called a  header file. 1)  In this line of code  include  is a keyword used to add libraries in our program. " iostream"  is the name of a library, added to our program. The  iostream  library helps us to get input data and show output data. The iostream library also has many more uses; it is not only limited to input and output. 2)  " int main() {" -  In this line of code, " int"  is a return type which is called integer and " main()"  is a function, the brackets " ()"  denotes that it is a function. The curly brace " {"  indicates that it is an opening of a function, and the curly brace " }"  indicates that it is the closing of a function.  3)  " return   0"  - In this line of code, the return keyword will return 0 as an integer to our main function " int   main()"  as we have discussed before. Returning 0 as a value to the main fu...