i don't know what i'm doing wrong in this program. i'm supposed to write a program that would encrypt and decrypts four-digit integers.it should encrypt it as follow: replace each digit by the remainder after the sum of that digit plus 7 is divided by 10. then swap the first digit with the third and the second digit with the fourth and then print the encrypted integer. same for decrypt. here is what i have:
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main(void)
{
char encrypt[] = "e";
char decrypt[] = "d";
//int x;
int num1;
int num2;
int num3;
int num4;
int anyNum1, anyNum2, anyNum3, anyNum4;
printf("Encrypt or Decrypt (e/d)\n");
scanf("%s", &encrypt);
while (num1 != 0, num2 != 0, num3 != 0, num4 != 0)
{
printf("Enter number\n");
scanf("%4d", &num1, &num2, &num3, &num4);
anyNum1 = printf("%d" + 7 / 10);
anyNum2 = printf("%d" + 7 / 10);
anyNum3 = printf("%d" + 7 / 10);
anyNum4 = printf("%d" + 7 / 10);
printf("1 2 3 4" " encrypted = %4d ", anyNum1, anyNum2, anyNum3, anyNum4);
}
//else
//{
// printf("Enter number\n");
// scanf("%4d", &num1, &num2, &num3, &num4);
// anyNum1 = (num1 * 10) - 7;
//anyNum2 = (num2 * 10) - 7;
//anyNum3 = (num3 * 10) - 7;
//anyNum4 = (num4 * 10) - 7;
// printf("1 2 3 4" " encrypted = %4d ", anyNum1, anyNum2, anyNum3, anyNum4);
//}
return 0;
}