AI Programming
11.2K subscribers
594 photos
42 videos
245 files
569 links
An artificial intelligence free resource channel for students, professionals, and anyone who wants to learn how to solve problems.

ENGINEERING πŸŽ– PROGRAMMING πŸŽ– TIPS & HACKS

https://youtube.com/c/AIProgramming
CONTACT US ON: @alphadmin12
Download Telegram
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 πŸ™ŒπŸ½
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
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 πŸ™ŒπŸ½
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 πŸ™ŒπŸ½
Java - Question & Answers
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
Below we posted screen shot of the question to the solution code we are going to be posted.

Tip: u gave us πŸ™πŸ½ Thanks!

Keep calm and wait for the upcoming java exercises.
β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”β€”
AI Programming @freecodecs
Have a LitπŸ”₯ Practice Folks πŸ™ŒπŸ½
Question : 12 & 13
Question : 14 & 15