Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dynamic input, functions, functions with different structures like co…
…nditional and iterative.
- Loading branch information
1 parent
fae4145
commit 2a08034
Showing
29 changed files
with
164 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
name = "class03" | ||
version = "0.1.0" | ||
authors = ["Admin <faheemuzzaman@hotmail.com>"] | ||
edition = "2018" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
// fn main() { | ||
// println!("The Sum is: {}", add_two_number(45, 30)); // Function Calling | ||
|
||
// println!("The Square is: {}", square(25)); | ||
|
||
// hello_world(); | ||
|
||
// print_name("Faheem".to_string()); | ||
// println!("The Square is: {}",calculate_square()); | ||
|
||
// let mut input_01 = String::new(); | ||
// io::stdin().read_line(&mut input_01); | ||
// let input_01:i32 = input_01.trim().parse().unwrap(); | ||
// let mut input_02 = String::new(); | ||
// io::stdin().read_line(&mut input_02); | ||
// let input_02:i32 = input_02.trim().parse().unwrap(); | ||
|
||
// println!("The greater input number is {}", check_maxV2(input_01, input_02)); | ||
|
||
// let cal_result = arthimatic_operations(input_01, input_02); | ||
// println!("The Sum is: {}",cal_result.0); | ||
// println!("The Sub is: {}",cal_result.1); | ||
// println!("The Mul is: {}",cal_result.2); | ||
// println!("The Div is: {}",cal_result.3); | ||
|
||
// let cal_sq_cb = square_and_cube(input_01); | ||
// println!("The number {} square is {} and cube is {}", | ||
// input_01,cal_sq_cb.0,cal_sq_cb.1); | ||
|
||
// let arrNum = [345,567,678,234,456,23]; | ||
// println!("The Max Number Is {}",largest(&arrNum)); | ||
|
||
// let arrNum02 = [345,567,6783,234,456,23]; | ||
// println!("The Max Number Is {}",largest(&arrNum02)); | ||
|
||
// } | ||
|
||
// // this function taking the two interger parameter and return the sum of the two numbers. | ||
// // // addTwoNumber function Name | ||
// // // (x:i32,y:i32) Function Paramerters | ||
// // // ->i32 indicates Return Type | ||
// // // sum | ||
// // // Function Decalartion | ||
|
||
// fn add_two_number(x:i32,y:i32)->i32{ | ||
// let sum:i32; | ||
// sum = x+y; | ||
// sum | ||
// } | ||
|
||
// // this function get the input parameter as integer and return the square of given number. | ||
// fn square(x:i32)->i32{ | ||
// x*x | ||
// } | ||
// // this function just print the single line statement. | ||
// fn hello_world(){ | ||
// println!("Hello World"); | ||
// } | ||
|
||
// // this function take one parameter as string and print it. | ||
// fn print_name(name:String){ | ||
// println!("The name is: {}",name); | ||
// } | ||
|
||
// // this function calculate the square on behalf of user dynamic input. | ||
// use std::io; | ||
// fn calculate_square()->i32{ | ||
// let mut input = String::new(); | ||
// io::stdin().read_line(&mut input); | ||
// let input:i32 = input.trim().parse().unwrap(); | ||
// input*input | ||
// } | ||
|
||
// // this function takes two input parameters and check which one is the largerst and print the larger one. | ||
// fn check_max(x:i32,y:i32)->String{ | ||
// if x>y{ | ||
// "The number 01 input is greater".to_string() | ||
// } | ||
// else{ | ||
// "The number 02 input is greater".to_string() | ||
// } | ||
// } | ||
// // this function takes two input parameters and check which one is the largerst and return the larger one. | ||
// fn check_maxV2(x:i32,y:i32)->i32{ | ||
// if x>y{ | ||
// x | ||
// } | ||
// else{ | ||
// y | ||
// } | ||
// } | ||
|
||
// // this function take the first name and last name using the dynamic input from the user | ||
// // and return the tuple as first name and lastname. | ||
// fn take_full_name()->(String,String){ | ||
|
||
// println!("Enter First Name"); | ||
// let mut input_01 = String::new(); | ||
// io::stdin().read_line(&mut input_01); | ||
// let input_01 = input_01.trim().to_string(); | ||
|
||
// println!("Enter Last Name"); | ||
// let mut input_02 = String::new(); | ||
// io::stdin().read_line(&mut input_02); | ||
// let input_02 = input_02.trim().to_string(); | ||
|
||
// (input_01,input_02) // return the tuple | ||
// } | ||
|
||
// // this function take one integer input (i32) and return the all mathematical operation addition, subtraction, | ||
// // multiplication and division. | ||
// fn arthimatic_operations(x:i32,y:i32)->(i32,i32,i32,i32){ | ||
// (x+y,x-y,x*y,x/y) | ||
// } | ||
|
||
// // this function take one integer input (i32) and return the square and cube in the form of tuple | ||
// fn square_and_cube(x:i32)->(i32,i32){ | ||
// (x*x,x*x*x) | ||
// } | ||
|
||
// // this function take input as integer (i32) array and return the largest value in array. | ||
// fn largest(arrNum:&[i32])->i32{ | ||
|
||
// let mut max = arrNum[0]; | ||
// for x in (1..arrNum.len()) | ||
// { | ||
// if max < arrNum[x]{ | ||
// max = arrNum[x]; | ||
// } | ||
// } | ||
// max | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"rustc_fingerprint":9484594007537757877,"outputs":{"1164083562126845933":["rustc 1.37.0 (eae3437df 2019-08-13)\nbinary: rustc\ncommit-hash: eae3437dfe991621e8afdc82734f4a172d7ddf9b\ncommit-date: 2019-08-13\nhost: x86_64-pc-windows-msvc\nrelease: 1.37.0\nLLVM version: 8.0\n",""],"4476964694761187371":["___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\nC:\\Users\\Admin\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\ndebug_assertions\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"msvc\"\ntarget_family=\"windows\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"pc\"\nwindows\n",""],"9311443727202421799":["___.exe\nlib___.rlib\n___.dll\n___.dll\n___.lib\n___.dll\nC:\\Users\\Admin\\.rustup\\toolchains\\stable-x86_64-pc-windows-msvc\ndebug_assertions\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"msvc\"\ntarget_family=\"windows\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_os=\"windows\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"pc\"\nwindows\n",""]},"successes":{}} |
Empty file.
Binary file added
BIN
+13 Bytes
.../target/debug/.fingerprint/class03-33ee0b8e2073046f/dep-test-bin-class03-33ee0b8e2073046f
Binary file not shown.
1 change: 1 addition & 0 deletions
1
class03/target/debug/.fingerprint/class03-33ee0b8e2073046f/invoked.timestamp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This file has an mtime of when this was started. |
1 change: 1 addition & 0 deletions
1
class03/target/debug/.fingerprint/class03-33ee0b8e2073046f/test-bin-class03-33ee0b8e2073046f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
26f5ecb1d31495f8 |
1 change: 1 addition & 0 deletions
1
...target/debug/.fingerprint/class03-33ee0b8e2073046f/test-bin-class03-33ee0b8e2073046f.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"rustc":16761476351873615079,"features":"[]","target":12670212195296036023,"profile":1647870076477133176,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":".fingerprint\\class03-33ee0b8e2073046f\\dep-test-bin-class03-33ee0b8e2073046f"}}],"rustflags":[],"metadata":11626969923688510520} |
1 change: 1 addition & 0 deletions
1
class03/target/debug/.fingerprint/class03-3e772c76143c3042/bin-class03-3e772c76143c3042
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
40cf6f1ba1dadff6 |
1 change: 1 addition & 0 deletions
1
class03/target/debug/.fingerprint/class03-3e772c76143c3042/bin-class03-3e772c76143c3042.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"rustc":16761476351873615079,"features":"[]","target":12670212195296036023,"profile":14891217944882224483,"path":1036222786711178230,"deps":[],"local":[{"CheckDepInfo":{"dep_info":".fingerprint\\class03-3e772c76143c3042\\dep-bin-class03-3e772c76143c3042"}}],"rustflags":[],"metadata":11626969923688510520} |
Binary file added
BIN
+13 Bytes
class03/target/debug/.fingerprint/class03-3e772c76143c3042/dep-bin-class03-3e772c76143c3042
Binary file not shown.
1 change: 1 addition & 0 deletions
1
class03/target/debug/.fingerprint/class03-3e772c76143c3042/invoked.timestamp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
This file has an mtime of when this was started. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
c:\Users\Admin\Desktop\Rust\class03\target\debug\deps\class03-33ee0b8e2073046f.rmeta: src\main.rs | ||
|
||
c:\Users\Admin\Desktop\Rust\class03\target\debug\deps\class03-33ee0b8e2073046f.d: src\main.rs | ||
|
||
src\main.rs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
c:\Users\Admin\Desktop\Rust\class03\target\debug\deps\class03-3e772c76143c3042.rmeta: src\main.rs | ||
|
||
c:\Users\Admin\Desktop\Rust\class03\target\debug\deps\class03-3e772c76143c3042.d: src\main.rs | ||
|
||
src\main.rs: |
Empty file.
Empty file.
Binary file added
BIN
+463 KB
...t/debug/incremental/class03-13x152yghghtl/s-fgva9m5yok-x0a2zi-3myesr4fjg373/dep-graph.bin
Binary file not shown.
Binary file added
BIN
+71.2 KB
...debug/incremental/class03-13x152yghghtl/s-fgva9m5yok-x0a2zi-3myesr4fjg373/query-cache.bin
Binary file not shown.
Binary file added
BIN
+37 Bytes
...bug/incremental/class03-13x152yghghtl/s-fgva9m5yok-x0a2zi-3myesr4fjg373/work-products.bin
Binary file not shown.
Empty file.
Binary file added
BIN
+463 KB
...target/debug/incremental/class03-13x152yghghtl/s-fgvaasauwn-19lwadv-working/dep-graph.bin
Binary file not shown.
Binary file added
BIN
+71.2 KB
...rget/debug/incremental/class03-13x152yghghtl/s-fgvaasauwn-19lwadv-working/query-cache.bin
Binary file not shown.
Binary file added
BIN
+37 Bytes
...et/debug/incremental/class03-13x152yghghtl/s-fgvaasauwn-19lwadv-working/work-products.bin
Binary file not shown.
Empty file.
Binary file added
BIN
+56.4 KB
.../debug/incremental/class03-3grbnp3ibo5bi/s-fgva9u2ovp-148wu1j-2wczd8dz120jp/dep-graph.bin
Binary file not shown.
Binary file added
BIN
+39.7 KB
...ebug/incremental/class03-3grbnp3ibo5bi/s-fgva9u2ovp-148wu1j-2wczd8dz120jp/query-cache.bin
Binary file not shown.
Binary file added
BIN
+37 Bytes
...ug/incremental/class03-3grbnp3ibo5bi/s-fgva9u2ovp-148wu1j-2wczd8dz120jp/work-products.bin
Binary file not shown.
Empty file.