Happy About the progress

This commit is contained in:
2026-05-28 10:16:10 +00:00
commit 79415e38db
92 changed files with 1326 additions and 0 deletions
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+20
View File
@@ -0,0 +1,20 @@
#include <stdio.h>
#include <cs50.h>
int main(void)
{
char c = get_char("Do you agree? ");
if (c == 'y' || c == 'Y')
{
printf("Agreed.\n");
}
else
{
printf("Not Agreed.'\n");
}
}
+18
View File
@@ -0,0 +1,18 @@
#include <cs50.h>
#include <stdio.h>
//Proacive Promise for future.
void meow(int tiomes);
int main (void)
{
int n = get_int("What's n? ");
meow(n);
}
void meow(int times)
{
for (int i = 0; i < times; i++)
{
printf("meow\n");
}
}
+15
View File
@@ -0,0 +1,15 @@
#include <cs50.h>
#include <stdio.h>
int main(void)
{
int x = get_int("What's x? ");
int y = get_int("what's y? ");
if (x < y)
{
printf("x is greater than y\n");
}
}
+8
View File
@@ -0,0 +1,8 @@
#include <cs50.h>
#include <stdio.h>
int main(void)
{
string answer = get_string("What's your name? ");
printf("Hello, %s\n", answer);
}
+13
View File
@@ -0,0 +1,13 @@
Conditional
If (boolean-expression)
{
}
else
{
}
// If the boolean-expression evaluates to true , all lines of code between phrases.
+39
View File
@@ -0,0 +1,39 @@
#include <cs50.h>
#include <stdio.h>
typedef struct
{
string name;
int votes;
} candidate;
candidate get_candidate(void);
int main(void)
{
candidate candidates[3];
for (int i =0; i <3; i++)
{
candidates[i] = get_candidate();
}
for (int i = 0; i < 3; i++)
{
printf("Candidate %i is named %s and has %i votes.\n",i + 1, candidates[i].name, candidates[i].votes);
}
}
// Function to get a new candidate
candidate get_candidate(void)
{
candidate new_candidate;
new_candidate.name = get_string("Name: ") ;
new_candidate.votes = get_int("Votes:") ;
return new_candidate;
}