Skip to content
This repository was archived by the owner on Feb 27, 2026. It is now read-only.
/ CModule3-1 Public archive

⚙️ ITSC 2181 C exercises — I/O formatting, conditionals, loops & file handling

Notifications You must be signed in to change notification settings

cwarre33/CModule3-1

Repository files navigation

ITSC 2181 Programming Exercises

Author: Cameron Warren

UNC Charlotte BID: 801289580

Course: ITSC 2181

Date: September 11, 2024


Overview

This repository contains concise solutions to C programming exercises covering input/output, conditionals, loops, and file handling. Each task focuses on reinforcing basic C programming skills.


Task 1: Input and Output Formatting

Objective

Read two characters, a float, and an integer from the user in a single line, then output each on a separate line.

Sample Run

Enter two characters, a space, a float, and a decimal:
Hi 3.141516 54
Hi
3.141516
54

Task 2: Conditional Evaluation

Objective

Evaluate if statements based on variable conditions and determine the value of a.

Key Results

- `if (b > c)`**False**  
- `if ((e / d) + 6)` → **True**  
- `if (a -= ((b > c) || (e / d)) + 6)`**True**, `a = 25`

Task 3: Grade Calculator

Objective

Determine the letter grade based on numeric input using if-else logic.

Sample Run

Please enter the numeric grade: 85  
The letter grade is a B.

Task 4: Loop Printing

Objective

Print x from 0 to 9 using a for loop.

Sample Run

x=0  
x=1  
...  
x=9

Task 5: Even and Odd Numbers

Objective

  1. Print the first 20 even numbers in ascending order.
  2. Print odd numbers between 50 and 20 in descending order.

Task 6: Running Sum with Sentinel Value

Objective

Continuously add user-entered numbers, terminating when -1 is input.

Sample Run

Current Sum: 0  
Please enter the next number: 5  
Current Sum: 5  
...  
Please enter the next number: -1  
Done!

Conclusion

These exercises reinforce C fundamentals through practical applications, including input handling, loops, and control structures.

About

⚙️ ITSC 2181 C exercises — I/O formatting, conditionals, loops & file handling

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages