I wrote program which use menu to execute function.
#include <iostream>
#include<conio.h>
#include <stdio.h>
#include <cstring>
using namespace std;
int menu();
void zad1();
void zad2();
int main(){
    switch(menu()){
        case 1: zad1();break;
        case 2: zad1();break;
        default: cout<<"blank";
    };
    getch();
    return 0;
}
int menu(){
    cout<<"Menu\n\n";
    cout<<"Zad.1\nZad.2\n";
    int wybor;
    cin>>wybor;
    return wybor;
}
int encryption(){
    char string[256];
    int i = 0;
    int key = 3;
    const int num_letters = 26;
    printf("Enter the string you want encrypted\n");
    fgets(string, sizeof(string), stdin);
    for (i = 0; i < strlen(string); i++) {
        if (string[i] >= 'a' && string[i] <= 'z') {
            string[i] = 'a' + (string[i] - 'a' + key) % num_letters;
        }
        else if (string[i] >= 'A' && string[i] <= 'Z') {
            string[i] = 'A' + (string[i] - 'A' + key) % num_letters;
        }
    }
    printf("Encrypted: %s\n", string);
    return 0;
}
void zad1(){
    encryption();
}
The only thing is I my output is not working properly - it shows the menu, I can type number (1-2) to choose function to execute and all I get from function "encryption" is:
Enter the string you want encrypted
Encrypted:
and that's all - I can't type character. What am I missing? I used the menu before and everything worked properly.
 
    