I wrote a code to implement Julias Caesar Cryptography in C.
The problem is that my fgets() is not waiting for input and skipping to fputs().
#include<stdio.h>
int main(){
    int size;
    printf("Enter the size of the string: ");
    scanf("%d",&size);
    int key;
    printf("Enter the key: ");
    scanf("%d",&key);
    char a[size];
    printf("Enter the string: ");
    fgets(a,size,stdin);
    for(int i=0;i<size;i++){
        a[i]+=key;
    }
    fputs(a,stdout);
    return 0;
}
I used CodeBlocks 17.12 to compile this C program.
My OS is Windows 7 (32-bit)
 
     
    