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

feat: assignment done #9

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
5 changes: 0 additions & 5 deletions src/addition.cairo

This file was deleted.

45 changes: 0 additions & 45 deletions src/aggregator_contract.cairo

This file was deleted.

28 changes: 0 additions & 28 deletions src/counter_contract.cairo

This file was deleted.

6 changes: 0 additions & 6 deletions src/errors.cairo

This file was deleted.

Empty file removed src/hello_starknet.cairo
Empty file.
55 changes: 50 additions & 5 deletions src/lib.cairo
Original file line number Diff line number Diff line change
@@ -1,5 +1,50 @@
mod addition;
mod errors;
mod ownable_contract;
mod counter_contract;
mod aggregator_contract;
fn main() {
short_str();
let result = check_num(30);
println!("result here: {result}");
let sum: u16 = add_num(10, 5);
println!("sum here: {sum}");
let sub: u32 = sub_num(8, 53);
println!("subtraction of two numbers is: {sub}");
let mul: u64 = multiply_num(4, 6);
println!("multiplying two numbers gives us: {mul}");
let div: u16 = divide_nums(2, 12);
println!("dividing two numbers gives us: {div}");
}

// short string data-type
fn short_str() {
println!("GM Cairo!");
}

// bool data type
fn check_num(n1: u8) -> bool {
if n1 > 20 {
return true;
}
return false;
}

// function to perform addition arithmetic operation
fn add_num(n1: u16, n2: u16) -> u16 {
let result: u16 = n1 + n2;
result
}

// subtract function
fn sub_num(n1: u32, n2: u32) -> u32 {
let result: u32 = n2 - n1;
result
}

// multiply function
fn multiply_num(n1: u64, n2: u64) -> u64 {
let result: u64 = n1 * n2;
result
}

// divide function
fn divide_nums(n1: u16, n2: u16) -> u16 {
let result: u16 = n2 / n1;
result
}
41 changes: 0 additions & 41 deletions src/ownable_contract.cairo

This file was deleted.