Advertisement
Guest User

0x71-en-v1.cpp

a guest
Sep 2nd, 2013
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.40 KB | None | 0 0
  1. /* immanuel yohanes patra (skraito) with Lord ( Jesus Christ )
  2.  * Thank You Lord ( Jesus Christ ) for this knowledge
  3.  * Coded in Pekanbaru at 02-SEP-2013 07:16 pm
  4.  * Love ya all True Jesus Church, my comrade as christian
  5.  * http://www.tjc.org
  6.  * and lastly to our team 0x71, http://0x71.org
  7.  * Purpose of the program :
  8.  * Testing C++ and learning
  9.  *
  10.  */
  11.  
  12.  #include <iostream>
  13.  using namespace std;
  14.  
  15.  
  16.  void test (char first_strings[], char second_strings[]);
  17.  
  18.  
  19.  int main () {
  20.    
  21.     /* Declaration of all variable */
  22.     char first_string[28], second_string[28];
  23.    
  24.    
  25.     cout << "==========================================";
  26.     cout << endl << "Enter your first string to encrypt : ";
  27.     cin.getline(first_string, 27);
  28.     cout << "Enter your second string to encrypt : ";
  29.     cin.getline(second_string, 27);
  30.     cout << "result is : ";
  31.     test(first_string,second_string);
  32.     return 0;
  33.  }
  34.  
  35.  
  36.  void test (char first_strings[], char second_strings[]) {
  37.    
  38.   /* Declaration of variables */
  39.  
  40.     int x = 0;
  41.     int y = 0;
  42.      
  43.     while ((first_strings[x] != '\0') || ( second_strings[y] != '\0' ))
  44.     {
  45.         if (first_strings[x] != '\0') {
  46.         cout << first_strings[x];
  47.         x++;
  48.         }
  49.        
  50.         if (second_strings[y] != '\0') {
  51.             cout << second_strings[y];
  52.         y++;
  53.         }
  54.        
  55.    }
  56.     cout << endl;
  57.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement