Posts

Showing posts from May, 2020

What is LDR and how it works with circuit to try on?

Image
  LDR ( Light-dependent resistor) A photo-resistor (or light-dependent resistor, LDR, or photo-conductive cell) is a light-controlled variable resistor. The resistance of a photo-resistor decreases with increasing incident light intensity; in other words, it exhibits photoconductivity. [1] In the dark, their resistance is very high, sometimes up to 1MΩ, but when the LDR the sensor is exposed to light, the resistance drops dramatically, even down to a few ohms, depending on the light intensity. LDRs have a sensitivity that varies with the wavelength of the light applied and are nonlinear devices. For example it can be used to turn on a light when the LDR is in darkness or to turn o­ a light when the LDR is in light. It can also work the other way around so when the LDR is in the light it turns on the circuit and when it’s in darkness the resistance increases and disrupts the circuit. How it Works? The way an LDR works is that they are made of many semi-conductive materials wit

Encrypted secrete messages in C++

How to send Encrypted secrete messages in C++ and Decrypt the same message? #include <iostream> #include<string> using namespace std ; int main() {     string message;     int i,a,word;     string letters ={ "ABCDEFGHIKLMNOPQRSTVXYZabcdefghijklmnopqrstuvwxyz" };     string key=     { "sub£rmatoglyphicAXPYRIQW\CMSWBFG@1029384756!&()=" };     cout << "Enter the message: " ;     getline( cin ,message);     string encrypted_message;     string decrypted;     for ( char c:message){     size_t position=letters.find(c);     if (position !=string::npos)     {     char new_char = key.at(position);     encrypted_message+=new_char;     }     else     {     encrypted_message+=c;     }     for ( char c:key)     size_t position=key.find(c);     if (position!=string::npos)     {     char new_char=letters.at(position);     decrypted +=new_char;     }     else     {     decrypted+=c;     }     }     cout << "\nEncrypted messa

Palindrome in C++

This program tells weather the word is palindrome or not and reverses the word given by the user with a number of letters. #include <iostream> #include <cstring> ##To use string library using namespace std; int main() {     string word;         int i;         int points=0;         cout << "Enter the palindrome word(small letter) you want check: ";         getline(cin, word); #Taking the input from the user         int a = word.length(); ##Counting numbers of words and storing in integer a         cout << "The word is " << a << " letters long." << endl;         cout << "The reverse word is ";         {               ##Use of reverse iterator to reverse the word             for (std::string::reverse_iterator rit = word.rbegin(); rit != word.rend(); ++rit)                              cout << *rit;         }         cout << &qu