- This topic is empty.
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
CS50's Introduction to Computer Science on Edx: Supplementary resource
CS50 threads to aide as a supplementary resource
CS50 threads to aide as a supplementary resource › Forums › CS50’s Introduction to Computer Science by Harvard University on Edx › Week 2 › Code to convert to cipher text only when alphabetical characters
Tagged: arrays, Caesar project, isalpha
#include<stdio.h>
#include<cs50.h>
#include<string.h>
#include<ctype.h>
int main(void)
{
string name = get_string("Enter: ");
printf("Entered text by user: %s\n", name);
int n = strlen(name);
printf("lenght of entered text: %i\n", n);
int key = get_int("enter key: ");
for (int i = 0; i < n; i++)
{
{
isalpha name = name + key;
}
}
printf("cipher text: %s\n", name);
}
Intend to convert to cipher text only when alphabetical characters. Facing problem coding if name is alphabetical, only then name = name + key.
Reply
https://edstem.org/us/courses/176/discussion/1002204[learn_press_profile]