HERE YOU GO I HAVE MADE YOU THE FIRST PROGRAM 

//part A

#include <iostream.h>

int main ()
{

        int digit;

        cout<<"Enter the four digit number.\n";
        cin>>digit;

int first = ( digit / 1000 + 7 ) % 10;
 int second = ( digit % 1000 / 100 + 7 ) % 10;
 int third = ( digit % 1000 % 100 / 10 + 7 ) % 10;
int fourth = ( digit % 1000 % 100 % 10 + 7 ) % 10;

        int temp = first;
        int temp1 =  second;
        int temp2 = third;
        int temp3 = fourth;

        //swap

        temp = third;
        temp1= fourth;
        temp2= first;
        temp3= second;

        third = third * 1000;
        fourth = fourth * 100;
        first = first* 10;
        second= second * 1;

        int encrypted = third + fourth + first + second;
        
cout<<"Encrypted number is "<<encrypted<<endl;

return 0;

}



Reply via email to