Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first step #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.23)
project(3207_Lab_Introduction C)

set(CMAKE_C_STANDARD 11)

include_directories(.)

add_executable(3207_Lab_Introduction
print_random.c
random.c random.h)
4 changes: 3 additions & 1 deletion print_random.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#include "random.h"


int main()
Expand All @@ -16,6 +16,8 @@ int main()
putchar( randchar() );
putchar('\n');

printf("Done");

return(0);
}

13 changes: 13 additions & 0 deletions random.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

#include <stdio.h>
#include <stdlib.h>
#include <time.h>



char randchar() {

char alpha = (rand() % 26) + 65;

return alpha;
}
11 changes: 11 additions & 0 deletions random.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//
// Created by Darshil Patel on 1/18/23.
//

#ifndef RANDOM_H_INCLUDED
#define RANDOM_H_INCLUDED


char randchar();

#endif //RANDOM_H_INCLUDED