Hi I tried running the following code -- although it is compiling it is not returning anything.
#include<cs50.h>
#include<stdio.h>
#include<ctype.h>
#include<stdlib.h>
#include<string.h>
int main(int argc, string argv[])
{
while(argc != 2)
{
printf("Please provide 2 arguments.\n");
return 1;
}
string a = GetString();
int p = atoi(argv[1]);
for(int i = 0; i < strlen(a); i++)
{
char m[i];
if(('A' <= a[i] && a[i] <= 'Z') || ('a' <= a[i] && a[i] <= 'z'))
{
m[i] = (a[i] + p) % 26;
}
else
{
m[i] = a[i];
}
printf("%c", m[i]);
}
return 0;
}