Initial commit with cleaned history
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
// Uppercases a string
|
||||
|
||||
#include <cs50.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
string s = get_string("Before: ");
|
||||
printf("After: ");
|
||||
for (int i = 0, n = strlen(s); i < n; i++)
|
||||
{
|
||||
if (s[i] >= 'a' && s[i] <= 'z')
|
||||
{
|
||||
printf("%c", s[i] - 32);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("%c", s[i]);
|
||||
}
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
Reference in New Issue
Block a user