Skip to main content

Basic Program: WAP to divide 20&5

WAP to divide 20&5

import java.util.*;
class divide
{
public static void main()
{
int a,b,c;
a=20;
b=5;
c=a/b;
System.out.println(c);
}
}
Output:- 4

Operator Used:- "/"

Comments

Popular posts from this blog

Phase 1:- Practical And Therory

1. Theory a. Object Oriented Programming b. Introduction To Java And BlueJ 2. Practical 1. Basic Program 2. Input Programs using Scanner 3. For Loop 4. While Loop 5. Do-While Loop 6. Nested Loop(Pattern Programming) 7. Input Inside Loop 8. Input Outside Loop 9. Input through parameter 10. Switch-Case Programming Important:- We will be completing our phase 1 by use import java.util.*; library. Use BlueJ and jdk 7.1 for programming

Data Types and Arithmetic Operators

For starting java programming we should know some operators at first you should know basic operators 1. Data Types 2. Operators a. Arithmetic Operators b. Relational Operators c. Logical Operators d. Unary Operators e. Assignment Operators 1. Data Types:- Data Types are the defined storage format that a variable can store to perform some specific operations. Each data types uses Java Keywords to be characterized. To utilize maximum amount of memory, Java provides a large number of Data Types. Data Types:- 1. Integer- int 2. Fractional- float, double 3. Character- char 4. Boolean- boolean Arithmetic Operators:- It is used to perform basic arithmetical operations such as addition, substraction, etc. Some Arithmetic Operators Addition- (+) Substraction- (-) Multiplication- (*) Division- (/) Modulus- (%) Modulus is used to find remainder.

Java Libraries

1. java.lang: it is used to support classes containing String, Character, Math, Integer, Thread, etc. 2. java.io: to support stream reader classes to deal with input and output statement. 3. java.applet: to support classes to generate applet - specific environment. 4. java.net: to support classes for network related operations and dealing with URL(Uniform Resource Locator) 5. java.awt: to support abstract window tool kit and also to manage GUI(Graphical User Interface) 6. java.txt: for supporting text elements such as dates, times and currency etc. 7. java.math: to support mathematical function such as square roots( integer and decimal both) In the first phase we will be continuing with basic program in BlueJ and some theories which will help you to understand