int main() { int value1, value2, m; string b="Enter a number: "; string a; cout<<b; getline(cin,a); stringstream(a)>>value1; cout<<b; getline(cin,a); stringstream(a)>>value2; m=value1*value2; if (m>50) cout<<"m > 50 and is equal to "<<m; else if (m<50) cout<<"m < 50 and is equal to "<<m; else cout<<"m = 50";cin.get(); return 0; }
#include <iostream > using std :: cout; using std :: endl; void encrypt( char [ ] ); // prototypes of functions used in the code void decrypt( char * ePtr ); int main( ) { // create a string to encrypt char string[ ] = "this is a secret!"; cout << "Original string is: " << string << endl; encrypt( string ); // call to the function encrypt( ) cout << "Encrypted string is: " << string << endl; decrypt( string ); // call to the function decrypt( ) cout << "Decrypted string is: " << string << endl; return 0; }// main
//encrypt data void encrypt (char e[] ) { for( int i=0; e[i] != '\0'; ++i ) ++e[i]; } // encrypt