Skip to main content

Finding whether the number is odd or even and positive or negative.


 finding whether the number is odd or even and positive or negative.
g.u.i:

coding for even or odd:
{
int NUM=Integer.parseInt(tf1.getText());
if(NUM%2==0)
tf2.setText("Even");
else
tf2.setText("Odd"); }

coding for positive or negative:
{
int NUM=Integer.parseInt(tf1.getText());
if(NUM>0)
tf3.setText("Positive");
else
tf3.setText("Negative"); }
coding for clear button:
{
tf1.setText("");
tf2.setText("");
tf3.setText(""); }
coding for exit button:
{ System.exit(0); }
Run time screenshot:


Popular posts from this blog

Sudo - SuperUser Access TERMUX

Sudo works on only rooted devices   sudo means superuser & root command we can run root tools in termux using sudo Execute these commands one by one to install sudo. Installation : $ apt update  $ apt upgrade $ apt install git $ apt install tsu $ apt install ncurses-utils $ git clone https://github.com/termux-sudo $ cd termux-sud $ cat sudo > /data/data/com.termux/files/usr/bin/sudo $ chmod 700 /data/data/com.termux/files/usr/bin/sudo sudo su sudo tsu Now you are a root user..

Creating a .zip file using TERMUX

Creating a .zip file using TERMUX or Kali Linux Fisrt update and install requirments .. $ apt update $ apt upgrade $ apt install zip $ apt install unzip ** Creating Zip file : $ zip name.zip [your files] Here name.zip is the name for that zip file **Unzip process : $ unzip name.zip that's it it will unzip your zip file.. Enjoy... All  Copyright  Are  Reserved ©