E
@Ekwegbalum_Unachukwu_MNSU_EDU
EE107 Lab8_4 by E.Unachukwu
/* This is the eighth lab of Lab EE107
The purpose of this lab understand how a program (using the switch case) that checks a freight cost
and print out the result.
Creating the code and free of syntax and grammatical errors.
Author: Ekwegbalum Unachukwu
Star ID:do2170dt
Date: March 19th, 2024.
*/
#include <stdio.h>
EE107 Lab8_3 by E.Unachukwu
/*This is the eighth lab of Lab EE107
The purpose of this lab understand how a program (if else) that checks prime number
and print out the result.
Creating the code and free of syntax and grammatical errors.
Author: Ekwegbalum Unachukwu
Star ID:do2170dt
Date: March 19th, 2024.
*/
#include <stdio.h>
#include <math.h>
EE107 Lab8_2 by E.Unachukwu
/*This is the eighth lab of Lab EE107
The purpose of this lab understand how a program (using switch case) that identify the operator used
and print out the result.
Creating the code and free of syntax and grammatical errors.
Author: Ekwegbalum Unachukwu
Star ID:do2170dt
Date: March 19th, 2024.
*/
#include <stdio.h>
EE107 Lab8_1 by E.Unachukwu
/*This is the eighth lab of Lab EE107
The purpose of this lab understand how a program (using if-else) that identify the operator used
and print out the result.
Creating the code and free of syntax and grammatical errors.
Author: Ekwegbalum Unachukwu
Star ID:do2170dt
Date: March 19th, 2024.
*/
#include <stdio.h>
HW2_5
#include <stdio.h>
int main(void) {
// Declare variables to store the exponent (n) and the result of 2 to the power of n.
int n, two_to_the_n;
// Display a header for the table.
printf("TABLE OF POWERS OF TWO\n\n");
printf("n 2 to the n\n");
printf(" ---- ---------------\n");
EE107 Lab7_4 by E.Unachukwu
/*This is the seventhth lab of Lab EE107
The purpose of this lab understand how a program that determine if the first is
evenly divisible by the second, and then display an appropriate
message at the terminal
Creating the code and free of syntax and grammatical errors.
Author: Ekwegbalum Unachukwu
Star ID:do2170dt
Date: March 12th, 2024.
*/
#include <stdio.h>
EE107 Lab7_3 by E.Unachukwu
/*This is the seventhth lab of Lab EE107
The purpose of this lab understand how a program that tests to see whether a
year is a leap year
Creating the code and free of syntax and grammatical errors.
Author: Ekwegbalum Unachukwu
Star ID:do2170dt
Date: March 12th, 2024.
*/
#include <stdio.h>
EE107 Lab7_2 by E.Unachukwu
/*This is the seventhth lab of Lab EE107
The purpose of this lab understand how a program Use do while
instead of while statement.
Creating the code and free of syntax and grammatical errors.
Author: Ekwegbalum Unachukwu
Star ID:do2170dt
Date: March 12th, 2024.
*/
#include <stdio.h>
EE107 Lab7_1 by E.Unachukwu
/* This is the seventh lab of Lab EE107
The purpose of this lab is to understand how a program calculates the greatest
common divisor (gcd) between two integers u and v.
Creating the code and free of syntax and grammatical errors.
Author: Ekwegbalum Unachukwu
Star ID: do2170dt
Date: March 12th, 2024.
*/
#include <stdio.h>
HW2_11
#include <stdio.h>
int main() {
int num;
int sum = 0;
int count = 0;
// Input integers until a non-integer input is provided
printf("Enter integers (enter a non-integer to stop):\n");
EE107 HW2_9_2
#include <stdio.h>
int main(void) {
// Declare variables to store the exponent (n) and the result of 2 to the power of n.
int n, two_to_the_n;
// Display a header for the table.
printf("TABLE OF POWERS OF TWO\n\n");
printf("n 2 to the n\n");
printf(" ---- ---------------\n");
EE107 HW2_1
#include <stdio.h>
int main() {
printf("n\tTriangular Number\n");
printf("--------------------\n");
for (int n = 5; n <= 50; n += 5) {
// Calculate the triangular number using the formula
int triangularNumberEU = n * (n + 1) / 2;
Lab 6.1 E.Unachukwu
/*
This is the sixth lab of Lab EE107
The purpose of this lab understand how a program can generate and display a table of n and n2, for
integer values of n ranging from 1 to 10 in C.
Creating the code and free of syntax and grammatical errors.
Author: Ekwegbalum Unachukwu
Star ID:do2170dt
Date: Feb 20, 2024.
*/
#include <stdio.h>
Lab 6.2 E.Unachukwu
/*
This is the sixth lab of Lab EE107
The purpose of this lab is to understand how the program calculates
the average of n decimal numbers.
The number n is input from the keyboard in C
The purpose is to create the code and free of syntax and grammatical errors
Author: Ekwegbalum Unachukwu
Star ID:do2170dt
Date: Feb 20, 2024.
*/
Lab 6.3 E.E Unachukwu
/*
This is the sixth lab of Lab EE107
The purpose of this lab is to understand the interation with for loop in C
The purpose is to create the code and free of syntax and grammatical errors
Author: Ekwegbalum Unachukwu
Star ID:do2170dt
Date: Feb 20, 2024.
*/
#include <stdio.h>
Practice.1
#include <stdio.h>
int main(void) {
// Declaration of variables
double n_EU, number_EU, triangularNumberEU, counter_EU;
triangularNumberEU = 0;
// Outer loop to handle five sets of input
for (counter_EU = 1; counter_EU <= 7; ++counter_EU) {
// Prompt user for input
Lab 5.3 E.Unachukwu
/*
This is the fifth lab of Lab EE107
The purpose of this lab is to understand the interation with for loop in C
The purpose is to create the code and free of syntax and grammatical errors
Author: Ekwegbalum Unachukwu
Star ID:do2170dt
Date: Feb 13, 2024.
*/
#include <stdio.h>
Lab 5.2 E.Unachukwu
/*
This is the fifth lab of Lab EE107
The purpose of this lab is to understand the interation with sequence for 2*n -1 for loop in C
The purpose is to create the code and free of syntax and grammatical errors
Author: Ekwegbalum Unachukwu
Star ID:do2170dt
Date: Feb 13, 2024.
*/
/*Program to calculate the series for the "for" statement*/
Lab 5.1 E.Unachukwu
/*
This is the fifth lab of Lab EE107
The purpose of this lab is to understand the iteration with for loop in C
The purpose is to create the code and free of syntax and grammatical errors
Author: Ekwegbalum Unachukwu
Star ID:do2170dt
Date: Feb 13, 2024.
*/
#include <stdio.h>
/*Program to calculate the 100th triangular number for the "for" statement*/
Code to Plot E.Unachukwu
import matplotlib.pyplot as plt
# Given data
voltage_supply = [12, 10, 8, 6, 4, 2, -2, -4, -6, -8, -10, -12]
voltage_set = [12, 10, 8, 6, 4, 2, -2, -4, -6, -8, -10, -12]
measured_current = [0.01222, 0.01018, 0.00815, 0.006108, 0.004071, 0.002065, -0.002034, -0.004064, -0.006096, -0.008133, -0.010175, -0.01222]
# Plotting
plt.figure(figsize=(10, 6))
plt.scatter(voltage_supply, measured_current, color='blue', label='Measured Current')