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
+34
View File
@@ -0,0 +1,34 @@
#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();
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;
}