Stack - Post & Eval.cpp
4.2 KB
Infix to Postfix & Evaluate Using Stack C++
βββββββββββββββ
Implementation of infix equation/expression to postfix expression converter and evaluator by using stack data structure method.
(N.B. We use stack class from library by calling #include <stack>, which is the same as doing inside our project by declaring function called pop & push.)
ββββββββββββββββ
AI Programming @freecodecs
Have a Litπ₯ Practice Folks ππ½
βββββββββββββββ
Implementation of infix equation/expression to postfix expression converter and evaluator by using stack data structure method.
(N.B. We use stack class from library by calling #include <stack>, which is the same as doing inside our project by declaring function called pop & push.)
ββββββββββββββββ
AI Programming @freecodecs
Have a Litπ₯ Practice Folks ππ½
~~ Difference between C and C++ ~~
The major difference between C and C++ is that C is a procedural programming language andπ does not support classes and objects, whileπ C++ is a combination of both procedural and object oriented programming language; therefore C++ can be called a hybrid language.
AI Programming @freecodecs
Have a Litπ₯ Practice Folks ππ½
The major difference between C and C++ is that C is a procedural programming language andπ does not support classes and objects, whileπ C++ is a combination of both procedural and object oriented programming language; therefore C++ can be called a hybrid language.
AI Programming @freecodecs
Have a Litπ₯ Practice Folks ππ½
Java -Exercises
βββββββββββββββ
Below are some java basics exercise source codes to help you practice the methods and little syntaxβs.
ββββββββββββββββ
AI Programming @freecodecs
Have a Litπ₯ Practice Folks ππ½
βββββββββββββββ
Below are some java basics exercise source codes to help you practice the methods and little syntaxβs.
ββββββββββββββββ
AI Programming @freecodecs
Have a Litπ₯ Practice Folks ππ½
N.B. (Correction / we think itβs error/ on line 5, which is - - j instead of -j )
On the first loop it will output
100 - βI am learning Java !!β
On the second loop it will output
1 - βI found it simple, portable and securedβ
This loops will be repeated 50 times since N/2 is 50 and the final keyword iteratively decrease the N until itβs null.
So a) 100 x 50 = 5000
b) 1 x 50 = 50
On the first loop it will output
100 - βI am learning Java !!β
On the second loop it will output
1 - βI found it simple, portable and securedβ
This loops will be repeated 50 times since N/2 is 50 and the final keyword iteratively decrease the N until itβs null.
So a) 100 x 50 = 5000
b) 1 x 50 = 50
Java - Important Code Note 1
βββββββββββββββ
IP Address
import java.net.InetAddress;
InetAddress IP = InetAddress.getLocalHost();
System. out. println("IP of my system is := "+IP. getHostAddress());
Maths Equations
Math.pow(b,s)
Math.sqrt()
ββββββββββββββββ
AI Programming @freecodecs
Have a Litπ₯ Practice Folks ππ½
βββββββββββββββ
IP Address
import java.net.InetAddress;
InetAddress IP = InetAddress.getLocalHost();
System. out. println("IP of my system is := "+IP. getHostAddress());
Maths Equations
Math.pow(b,s)
Math.sqrt()
ββββββββββββββββ
AI Programming @freecodecs
Have a Litπ₯ Practice Folks ππ½
Java - Important Code Note 2
ββββββββββββββββ
Reverse Number
public class ReverseNumber {
public static void main(String[] args) {
int num = 1234, reversed = 0;
while(num != 0) {
int digit = num % 10;
reversed = reversed * 10 + digit;
num /= 10;
}
System.out.println("Reversed Number: " + reversed);
}
}
ββββββββββββββββ
AI Programming @freecodecs
Have a Litπ₯ Practice Folks ππ½
ββββββββββββββββ
Reverse Number
public class ReverseNumber {
public static void main(String[] args) {
int num = 1234, reversed = 0;
while(num != 0) {
int digit = num % 10;
reversed = reversed * 10 + digit;
num /= 10;
}
System.out.println("Reversed Number: " + reversed);
}
}
ββββββββββββββββ
AI Programming @freecodecs
Have a Litπ₯ Practice Folks ππ½