0% found this document useful (0 votes)
2 views20 pages

STANDARD12 Practical Assignment

Uploaded by

prkvs2023
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views20 pages

STANDARD12 Practical Assignment

Uploaded by

prkvs2023
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

PAGE NO.

1
Chapter 7 Java Basics Ãkúfhý : 7 òðkLke {q¤¼qík çkkçkíkku
PRACTICAL NO. 1 File Name - [Link]
# Create a java program that will compute the cost of phone call and
update balance.
• yuðe økýíkhe fhíkku òðk Ãkúkuøkúk{ çkLkkðku fu VkuLkfku÷Lkk ¾[oLke økýíkhe fhu yLku Ãknu÷ktÚke [qfðu÷e hf{ {kt
MkwÄkhku fhu.
public class CallCost
OUTPUT OF CODE LISTING
{
>javac [Link]“
public static void main(String[]args)
>Exit code: 0“
{
>java -cp . CallCost
double balance;
“Call Duration:
double rate;
37.0
double duration;
Seconds
double cost;
Balance:132.26Rupees
>Exit code: 0“
balance=170;
rate=1.02;
duration=37;
cost=duration*rate;
balance=balance-cost;

[Link]("Call Duration:");
[Link](duration);
[Link]("Seconds");
[Link]("Balance:" +balance+ "Rupees");
}
}
PRACTICAL NO. 2 File Name - [Link]
# Create a java program that will compute the cost of Simple Interest.
• MkkËk ÔÞksLke økýíkhe fhe ÔÞks{wÆ÷ økýíkhe fhe ykÃkíkku Mkh¤ òðk Ãkúkuøkúk{ íkiÞkh fhku.
public class Interest
{
OUTPUT OF CODE LISTING
public static void main(String[]args)
>javac [Link]“
{
>Exit code: 0“
double principal;
>java -cp . Interest
double rate;
“principal amount17000.0Repees
double duration;
Deposit for duration of3.0 years
double maturity;
interest Rate9.5%
double interest;
Maturity amount21845.0Repees
>Exit code: 0“
principal=17000;
rate=9.50;
duration=3;
PAGE NO. 2
interest=principal*duration*rate/100;
maturity=principal+interest;
[Link]("principal amount" +principal+ "Repees");
[Link]("Deposit for duration of" +duration+ "years");
[Link]("interest Rate" +rate+ "%");
[Link]("Maturity amount" +maturity+ "Repees");
}
}
PRACTICAL NO. 3 File Name - [Link]
# Using Arithmatic Operator create Java program.
• Arithmatic operator (ytføkrýíkeÞ Ãkúr¢Þf)Lkku WÃkÞkuøk Ëþkoðíkku òðk Ãkúkuøkúk{
public class ArithOpeators
OUTPUT OF CODE LISTING
{
>javac [Link]“
public static void main(String[]args)
>Exit code: 0“
{ >java -cp . ArithOpeators
short x=6; “x is6,y is3
int y=3; x+y=9
float a=12.5f; x-y=3
float b=7.2f; x/y=2
x%y=0
x%y=0
[Link]("x is" +x+",y is" +y);
x%y=-2
[Link]("x+y=" +(x+y)); x%y=2
[Link]("x-y=" +(x-y)); a is12.5,b is7.2
[Link]("x/y=" +(x/y)); a/b=1.7361112
[Link]("x%y=" +(x%y)); a/x=2.0833333
x=-6; a%x=0.5
[Link]("x%y=" +(x%y)); a%b=5.3
>Exit code: 0
y=-4;
[Link]("x%y=" +(x%y));
x=6; y=-4;
[Link]("x%y="+(x%y));

[Link]("a is" +a+",b is" +b);


[Link]("a/b=" +(a/b));
[Link]("a/x=" +(a/x));
[Link]("a%x=" +(a%x));
[Link]("a%b=" +(a%b));

}
}
PAGE NO. 3
Chapter 8 Classes & Objects in Java
Ãkúfhý : 8 òðk{kt õ÷kMk yLku ykìçsuõx
PRACTICAL NO. 4 File [Link]
# To understand the concept of class and object in java program.
• MkkËk ÔÞksLke økýíkhe fhe ÔÞks{wÆ÷ økýíkhe fhe ykÃkíkku Mkh¤ òðk Ãkúkuøkúk{ íkiÞkh fhku.
class Room
{
float length,width,height; OUTPUT OF CODE LISTING
byte nWindows;
>javac [Link]“
void setAttr (float l, float w, float h, byte n) >Exit code: 0“
{ >java -cp . Interest
length=l; width=w; height=h; “principal amount17000.0Repees
nWindows=n; Deposit for duration of3.0 years
}
interest Rate9.5%
double area()
{ Maturity amount21845.0Repees
return (length * width); >Exit code: 0“
}
void display()
{
[Link]("\nLength:" +length);
[Link]("Width:" +width);
[Link]("height:" +height);
[Link]("Number of windows:" +nWindows);
}
}
class RoomDemo
{
public static void main(String[]args)
{
Room r1; r1=new Room();
Room r2;
r2 = new Room();

[Link]();
[Link]();

[Link] (18,12.5f,10, (byte)1);


[Link] (14,11,10, (byte)2);

[Link]();
[Link]();

[Link]("\nArea of room with length" + [Link] + "width"


+[Link]+"is" +[Link]());
[Link]("\nArea of room with length" +[Link] +"width" +
[Link] + "is" + [Link]());
}
}
PAGE NO. 4
PRACTICAL NO. 5 File [Link]
# To understand the concept of class and object in java program.
• 3 Úke 100 Lktçkh ðå[u hnu÷ yrð¼ksÞ MktÏÞk (prime nos.) AÃkkðíkku òðk Ãkúkuøkúk{ ÷¾ku.

OUTPUT OF
class Prime CODE LISTING
{ >javac
static boolean isPrime(int n) [Link]“
{ >Exit code: 0“
int i,last; >java -cp .
primeClassMethod
if (n<=1)return false; “Prime numbers
if(n<4)return true; between 3 and 100:
3
last = (int)[Link](n); 5
i=3; 7
do 11
{ 13
if (n%i==0)return false; 17
i=i+2; 19
} 23
while (i<last); 25
29
return true; 31
} 35
37
} 41
43
class primeClassMethod 47
{ 49
public static void main(String[]s) 53
{ 59
int i, n; 61
67
[Link] ("Prime numbers between 3 and 100:"); 71
for (n=3; n<100; n=n+2) 73
{ 79
if ([Link](n))[Link](n); 83
} 89
} 97
}
>Exit code: 0“

PAGE NO. 5
PRACTICAL NO. 6 File [Link]
# Using user-defined no-argument constructor.
class Room
{ OUTPUT OF CODE LISTING
float length, width, height; >javac [Link]“
byte nWindows; >Exit code: 0“
static int totWindows; >java -cp . RoomConstructorDemoA
Length:16.0
Room (float l, float w, float h, byte n) Width:12.5
{ Height:10.0
length=l; width=w; height=h; Windows:1
nWindows=n; totWindows+=n;
}
Length:20.0
Room(float l, float w) Width:14.0
{ Height:12.0
length=l; width Windows:2
=w; height=10; “Total number of Windows :3
nWindows=1; totWindows++; >Exit code: 0“
}

double area()
{
return (length * width);
}
void display()
{
[Link]("\nLength:" +length+ "\nWidth:" +width);
[Link]("Height:" +height);
[Link]("Windows:" +nWindows);
}
}
class RoomConstructorDemoA
{
public static void main (String args[])
{
Room r1=new Room(16,12.5f);
Room r2=new Room(20,14,12,(byte)2);
[Link](); [Link]();
[Link] ("\nTotal number of Windows :" +[Link]);
}
}

PAGE NO. 6
PRACTICAL NO. 7 File Name - [Link]
# Default visibility modifier, available everywhere in a package.
class Rectangle
{
double length,width; OUTPUT OF CODE LISTING
>javac [Link]“
void setAttributes(double x, double y) >Exit code: 0“>java -cp . RectangleDemo
{
“Rectangle with length=10.5width=20.0
length=x; width=y;
Area of rectangle is=210.0
}
double area() Area of recangle with length=10.0
{ width=15.0is150.0
return length * width; >Exit code: 0“
}
void display()
{
[Link]("Rectangle with length=" +length+ "width=" +width);
}
}
class RectangleDemo
{
public static void main(String[]s)
{
Rectangle rect1;
rect1=new Rectangle();
Rectangle rect2=new Rectangle();
[Link](10.5,20);
[Link]();
[Link]("Area of rectangle is=" +[Link]());
[Link](10,15);
[Link]("Area of recangle with length="
+[Link]+"width="+[Link] + "is" +[Link]());
}
}

Chapter 9 Working with Array and String


Ãkúfhý : 9 yuhu yLku ®MxÙøkLkku WÃkÞkuøk
PRACTICAL NO. 8 File Name - [Link]
# Array object with its elements initialized by default values.
Use an array in java program.
• “yuhu-ykuçsufx” Lkk ½xfkuLku ÃkqðrLkãkrhík rft{íkku Ãkúkhtr¼f íkhefu ykÃkðe.
class Array1
{
public static void main (String[]s)
{

PAGE NO. 7
int marks[]; OUTPUT OF
marks=new int[7]; CODE LISTING
>javac [Link]“
>Exit code: 0“
for (int i=0; i<7; i++) >java -cp . Array1“marks[0]is0
marks[1]is0
{ marks[2]is0
[Link]("marks["+i+"]is" +marks[i]); marks[3]is0
} marks[4]is0
marks[5]is0
} marks[6]is0
} >Exit code: 0

PRACTICAL NO. 9 File Name - [Link]


# Different ways to create and initialize array object.
• “yuhu-ykuçsufx” çkLkkððk íkÚkk íkuLkk ½xfkuLku Ãkúkhtr¼f rft{íkku ykÃkðkLke rðrðÄ heík.
class Array2
{
public static void main(String[]s) OUTPUT OF CODE LISTING
{ >javac [Link]“
int marks1[];
>Exit code: 0“
marks1=new int[3];
>java -cp . Array2“
int marks2[] = new int[3];
Array marks1: 0 0 0
int [] marks3= new int[3];
Array marks2: 0 0 0
int marks4[] = {50,60,70};
Array marks3: 0 0 0
int[] marks5= {70,80,90};
Array marks4: 50 60 70
Array marks5: 70 80 90
[Link]("Array marks1:\t");
>Exit code: 0“
display(marks1,3);
[Link]("Array marks2:\t");
display(marks2,3);
[Link]("Array marks3:\t");
display(marks3,3);
[Link]("Array marks4:\t");
display(marks4,3);
[Link]("Array marks5:\t");
display(marks5,3);
}
static void display (int arr[], int size)
{
for(int i=0; i<size; i++)
{
[Link](arr[i] + "\t");
}
[Link]();
}
}

PAGE NO. 8
PRACTICAL NO. 10 File Name - [Link]
# Java program to computer average of 10 numbers using 1-D array & loop.
• 10 yÃkqýkof MktÏÞkykuLke Mkhuhkþ ({æÞf) þkuÄðk {kxuLkku òðk Ãkúkuøkúk{
class ArrayAvg
{
public static void main(String[]s)
{
double numbers[]={10.5,20.6,30.8,15.5, 17.3,25.5,27.2,20,30,18.5};
byte ctr; OUTPUT OF CODE LISTING
double sum=0, avg; >javac [Link]“
>Exit code: 0“
>java -cp .
[Link]("list of numbers is"); ArrayAvg“list of numbers is
for (ctr=0; ctr<10; ctr++) 10.5
20.6
{ 30.8
[Link](numbers[ctr]); 15.5
17.3
sum=sum+numbers[ctr]; 25.5
} 27.2
avg=sum/10; 20.0
30.0
[Link]("\n Average of above number is" +avg); 18.5
} “ Average of above number is21.59
>Exit code: 0“
}

PRACTICAL NO. 11 File Name - [Link]


# Using sort() and fill() methods of Array class.
• òðk{kt yuhu f÷kMkLke sort() yLku fill() {uÚkzLkku WÃkÞkuøk fhðku.

class ArraysClassSortFill OUTPUT OF CODE LISTING


{ >javac [Link]“
>Exit code: 0“
public static void main (String[]s) >java -cp . ArraysClassSortFill
{ “Initial Elements :
6.4
double list[]={6.4,8,7.8,9.8,9.5,6,7,8,8.5,5.9}; 8.0
int indx; 7.8
[Link]("Initial Elements :"); 9.8
9.5
display(list); 6.0
[Link](list,3,9); //soft partial array 7.0
8.0
[Link]("\n sort whole array:"); 8.5
display(list); 5.9
“ sort whole array:
6.4
[Link](list,7); //fill whole array 8.0
[Link]("\n Fill whole array:"); 7.8
6.0
display(list); 7.0
[Link](list,2,6,5); //fill partial array 8.0
[Link]("\n Fill partial array: list[2] to list[5]"); 8.5
9.5
display(list); 9.8
} 5.9
PAGE NO. 9
static void display(double ary[])
{
for(int i=0; i<[Link]; i++)
{
[Link](ary[i] +"\t");
}
[Link]();
}
}
PRACTICAL NO. 12 File Name - [Link]
# Program using 2-D array with variable number of columns.
• “y÷øk-y÷øk MktÏÞk{kt Míkt¼ Ähkðíkk 2-D yuhuLkku Ãkúkuøkúk{{kt WÃkÞkuøk”

class Array2Dchar
{
public static void main(String [] s)
{
char names[][]= {
{'j','a','v','a'},
{'c'},
{'c','+','+'},
{'B','a','c','i','c'},
{'p','a','s','c','a','l'},
};
[Link]("Number of elements in 2D array :" +[Link] + "\n");

[Link]("five names stored in 2-d array of characters: \n");


display(names,5);
}
static void display(char arr[][],int rows)
{
for(int i=0;i<rows;i++)
{
[Link]("Row"+i + arr[i].length + "character elements");
for(int j=0; j<arr[i].length; j++)
{ OUTPUT OF CODE LISTING
>javac [Link]“
[Link](arr[i][j]); >Exit code: 0“
} >java -cp . Array2Dchar
[Link](); “Number of elements in 2D array :5
“five names stored in 2-d array of characters:
}

} Row04character elements java
Row11character elements c
} Row23character elements c++
Row35character elements Bacic
Row46character elements pascal
>Exit code: 0“
PAGE NO. 10
PRACTICAL NO. 13 File Name - [Link]
# Creating objects of class String using various constructors.
• “rðrðÄ fLMxÙfxhLkk WÃkÞkuøk ðzu string f÷kMkLkk ykuçsufx çkLkkððk”
import [Link];
public class str1
OUTPUT OF CODE LISTING
{
public static void main(String[] args) >javac [Link]“
{ >Exit code: 0“
char name[]={'K','N','O','W','L','E','D','G','E'}; >java -cp . str1
String str2=new String(name); “str2 is KNOWLEDGE
String str3=new String(name,1,2); str3 isNO
String str4=new String(str3); str4 isNO
String str5=new String("KNOWLEDGE"); str5 isKNOWLEDGE
[Link]("str2 is" + str2);
>Exit code: 0“
[Link]("str3 is" +str3);
[Link]("str4 is" +str4);
[Link]("str5 is" +str5);
}
}
Chapter 10 Exception handling in Java
Ãkúfhý : 10 òðk{kt yÃkðkËYÃk ÃkrhÂMÚkríkLkwt ÔÞðMÚkkÃkLk
PRACTICAL NO. 14 File Name - [Link]
# A program that illustrates Compile-time Error.
• “yÄorðhk{ r[nTLkLke f{e” çkíkkðíkku ¼q÷ Ëþkoðíkku Ãkúkuøkúk{.
class ErrorDemo >javac [Link]“[Link]:
{ error: ';' expected
public static void main(String args[]) [Link]("Welcome to the world of computer.")
^
{ 1 error OUTPUT OF CODE LISTING
[Link]("Welcome to the world of computer.") >Exit code: 1“>java -cp . ErrorDemo“Error:
Could not find or load main class ErrorDemo
} >Exit code: 1“
}
PRACTICAL NO. 15 File Name - [Link]
# A program that illustrates Run-time Error.
• “y{÷ Ëhr{ÞkLk” ¼q÷ Ëþkoðíkku Ãkúkuøkúk{. OUTPUT OF CODE LISTING
>javac [Link]“
class runtimeerrordemo >Exit code: 0“
>java -cp . runtimeerrordemo“statement to be executed before
{ displaying the fifth element Exception in thread "main"
public static void main(String args[]) [Link]: 5
at [Link]([Link])
>Exit code: 1“
{
String city[]={"Ahmedabad","Baroda","rajkot","surat",};
[Link]("statement to be executed before displaying the fifth element");
[Link](city[5]);
[Link]("statement to be executed after display the fifth element");
}
}
PAGE NO. 11
PRACTICAL NO. 16 File Name - [Link]
# A program illustrating arithmetic exception.
• “ økkrýríkf yÃkðkËLkwt ÿüktík ykÃkíkku Ãkúkuøkúk{ ”
class runtimeerrordemo2 OUTPUT OF CODE LISTING
{ “statement to be executed before performing didvion
public static void main(String args[]) operation Exception in thread "main"
{ [Link]: / by zero at
int numerator=15; [Link]([Link])
int denomator= 0; >Exit code: 1“
int answer;
[Link]("statement to be executed before performing division operation");
answer=numerator/denomator;
[Link]("statement to be executed after performing division operation");
}
}
PRACTICAL NO. 17 File Name - [Link]
# Program which illustrates finally block without catch block.
• “Catch” rð¼køk rMkðkÞ finally rð¼køk Mk{òðíkku Ãkúkuøkúk{

class finallydemo
{
public static void main(String args[])
{
String citylist[]={"ahmedabad","baroda","rajkot","surat"};
int numerator=15,denominator=0,answer;
[Link]("statement to be executed before try block");
try OUTPUT OF CODE LISTING
{ >javac [Link]“
[Link]("begining of try block....."); >Exit code: 0“
>java -cp . finallydemo
[Link](citylist[5]); “statement to be executed before try block
answer=numerator/denominator; begining of try block.....
this part of code will always get executed
[Link]("end of try block...."); Exception in thread "main"
} [Link] at
finally [Link]([Link])
>Exit code: 1“
{
[Link]("this part of code will always get executed");
}

[Link]("end of program...");
}
}

PAGE NO. 12
Chapter 11 File handling Ãkúfhý : 11 VkR÷ ÔÞðMÚkkÃkLk
PRACTICAL NO. 18 File Name - [Link]
# Program to list files in a given directory.
• ykÃku÷ rzhufxhe{kt WÃk÷çÄ VkE÷kuLke ÞkËe {u¤ððk {kxuLkku Ãkúkuøkúk{ ÷¾ku.
import [Link]; OUTPUT OF CODE LISTING
public class ListFiles >javac [Link]“
{ >Exit code: 0“
>java -cp . ListFiles
public static void main(String args[])
“List of files in
{ the Directory: C:\Windows
String path= "C:/Windows"; [Link]
String files; [Link]
[Link]
int countOfFiles; [Link]
try [Link]
{ [Link]
[Link]
File folder= new File(path); [Link]
File[] objects;
File[] listOfFiles=[Link]();
countOfFiles= [Link];
[Link]("List of files in the Directory:");
[Link]([Link]());
for(int i=0;i<countOfFiles;i++)
{
if(listOfFiles[i].isFile())
{
files=listOfFiles[i].getName();
[Link](files);
}
}
}
catch(Exception eobj)
{
[Link](eobj);
}
}
}
PAGE NO. 13
PRACTICAL NO. 19 File Name - [Link]
# Program to illustrate file writer operation.
• VkE÷{kt fuðe heíku ÷¾ðwt íkuLkwt ðýoLk fhíkku Ãkúkuøkúk{ ÷¾ku.
import [Link].*;
class FileWriterDemo
{
public static void main(String args[])
{
FileWriter fwobject= null;
try {
fwobject = new FileWriter("[Link]");
[Link]("File writing stats...");
for(int i=1; i< 11; i++)
[Link]("Line:" +i+ "\n");
[Link]("File writing ends...");
}
catch(Exception eobj)
{
[Link](eobj);
}
finally
{
try{
[Link]();
}
catch(Exception eobj)
{
[Link](eobj);
}
}
}
}

PAGE NO. 14
PRACTICAL NO. 20 File Name - [Link]
# Program to illustrate file read operation.
• VkE÷{ktÚke fuðe heíku ðkt[ðwt íkuLkwt ðýoLk fhíkku Ãkúkuøkúk{ ÷¾ku.

import [Link].*;
class FileReaderDemo
{
public static void main(String args[])
{
FileReader frobject = null;
try {
frobject = new FileReader("[Link]");
int i;
char ch;
while((i= [Link]())!= -1)
{
ch= (char) i;
[Link](ch);
} OUTPUT OF CODE LISTING
} >javac [Link]“
catch(Exception eobj) >Exit code: 0“>java -cp . FileReaderDemo
{ “File writing stats...Line:1
[Link](eobj); “Line:2
“Line:3
} “Line:4
finally “Line:5
{ “Line:6
try{ “Line:7
[Link](); “Line:8
} “Line:9
“Line:10
catch(Exception eobj)
“File writing ends...>Exit code: 0
{
[Link](eobj);
}
}
}
}

PAGE NO. 15
PRACTICAL NO. 21 File Name - [Link]
# Program to add two numbers.
• WÃkÞkuøkfíkko ÃkkMkuÚke ÃkhMÃkh MktðkË æðkhk çku MktÏÞk ðkt[u yLku íku çku MktÏÞkLkku Mkhðk¤ku Ëþkoðu íku {kxuLkku Ãkúkuøkúk{.

import [Link].*;
import [Link].*;
class ScannerInputDemo
{
public static void main(String args[])
{
Scanner kbInput=null;
int number1;
int number2;
int sum=0;
try
{
kbInput=new Scanner([Link]);
[Link]("Enter the first number:");
number1=[Link]();
[Link]("Enter the second number:");
number2=[Link]();
sum=number1+number2;
[Link]("Sum is : " +sum);
}
catch(Exception eobj)
{ OUTPUT OF CODE LISTING
[Link](eobj); >javac [Link]“
} >Exit code: 0“
finally >java -cp . ScannerInputDemo
{ “Enter the first number:20
try { Enter the second number:40
[Link](); Sum is : 60
>Exit code: 0
}
catch(Exception eobj)
{
[Link](eobj);
}
}
}
}
PAGE NO. 16
PRACTICAL NO. 22 File Name - [Link]
# Accepts input from a file “[Link]” and calculates the total marks of
each student.
• Ëhuf rðãkÚkeoLkku zuxk ðkt[e íkuLkk fw÷ økwýLke økýíkhe fhðk {kxuLkku Ãkúkuøkúk{ ÷¾ku.
import [Link].*;
import [Link].*; OUTPUT OF CODE LISTING
class ScannerFileDemo >javac [Link]“
{ >Exit code: 0“
public static void main(String args[]) >java -cp . ScannerFileDemo
{ “Defalut delimeter is:\p{javaWhitespace}+/n
Scanner fileinput=null; Total marks of Rollno1,Dhruvi are :294
int rollno, mark1, mark2, mark3, totalmarks; Total marks of Rollno2,Payal are :262
String name=null; Total marks of Rollno3,Vibhuti are :236
FileReader frobject = null; Total marks of Rollno4,Bhaveshri are :278
try Total marks of Rollno5,Shreeya are :266
{ >Exit code: 0
frobject = new FileReader("C:/school/[Link]");
fileinput=new Scanner(frobject);
[Link]("Defalut delimeter is : "+[Link]()+"/n");
while([Link]())
{
rollno=[Link]();
name=[Link]();
mark1=[Link]();
mark2=[Link]();
mark3=[Link]();
totalmarks=mark1+mark2+mark3;
[Link]("Total marks of Rollno" +rollno+","+name+" are :" +totalmarks);
}
[Link]();
}
catch(Exception eobj)
{
[Link](eobj);
}
}
}

Note :- Notepad [k÷w fhe Lke[uLke VkE÷ çkLkkðku. VkE÷Lku "C:/school/[Link]" Lkk Lkk{Úke Mkuð fhku.

1 Dhruvi 98 97 99
2 Payal 78 95 89
3 Vibhuti 95 57 84
4 Bhaveshri 95 85 98
5 Shreeya 95 84 87

PAGE NO. 17
Chapter 12 Publishing documents using LaTeX
Ãkúfhý : 12 ÷uxuõMkLke {ËËÚke ËMíkkðusLkwt «fkþLk
PRACTICAL NO. 23 File Name - [Link]
# Line handling example source file.
• ÷uxufMk{kt Mkíkík ÷¾ký yLku ÷¾ký{kt ÷kELkçkúuf Ëþkoðíkwt ÷¾ký Ëþkoðku.
Mkki ÃkúÚk{ start - All Programs - MikTex 2.9- TeXworks Open fhku.
Lke[u ykÃku÷ fkuz xkEÃk fhe [Link] Lkk{Úke Mkuð fhku.
\documentclass[12pt]{article}
\title{Line handling in \LaTex} OUTPUT OF CODE LISTING
\date{May 2013}
\begin{document}
\maketitle
\section{Continuous Text}\textsf
{
We have no wings, we cannot fly
But we have legs to sail and climb
By slow degrees and by and by
The cloudy summits of our time
}
\section{Text with Seperate Lines} \textsf
{
Heights by great men reached and kept \\
Where not attained by a sudden flight \\
But they, while their companions slept, \\
Were toiling upwards in the night
}
\end{document}
PRACTICAL NO. 24 File Name - [Link]
# Demonstration of the math environments.
• ÷uxufMk{kt ÷¾ký yLku økkrýríkf yuLðkÞLko{uLxLkwt ÃkúËþoLk fhíkku Ãkúkuøkúk{ ÷¾ku.

\documentclass[12pt] {article}
\usepackage{amsmath}
OUTPUT OF CODE LISTING
\title{Introduction to \LaTeX}
\date{May 2013}
\begin{document}
\section*{math environment}
The quadratic equation, in its general form, is
\begin{math}
ax^2 + bx + c = 0
\end{math}.
You learnt about them in class X.
PAGE NO. 18
The quadratic equation, in its general form, is
$ax^2 + bx + c = 0$. You learnt about them in
class X.
\section*{displaymath environment}
The quadratic equation, in its general form, is
\begin{displaymath}
ax^2 + bx + c = 0
\end {displaymath}. You learnt about them in class X

\end{document}
PRACTICAL NO. 25 File Name - [Link]
# A sample book in Latex.
• ÷uxufMk 5wMíkfLku fE heíku økkuXðu Au íku Ëþkoðíkku Ãkúkuøkúk{ ÷¾ku.
\documentclass[12pt]{book}
\usepackage{amsmath}
\title{\huge Mathematics \\ [3\baselineskip]
\Large Standard 12}
\author { Gujarat State Board of School Textbooks}
\date{2013}
\setcounter{secnumdepth}{2}
\setcounter{tocdepth}{1}
\begin{document}
\frontmatter
\maketitle
\chapter{\MakeUppercase{Fundamental Duties}}
\tableofcontents
\chapter{\MakeUppercase{About This Textbook....}}
\mainmatter Page -1
\part{Semester I}
\section{Introduction}
\section*{exercise 1.1}
\section{Properties of the Union Operation}
\subsection{Union is a Binary Operation}
\subsection{Properties of the Intersection Operation}
\subsection{Intersection is a Binary Operation}
\subsection{Associative Law}
\chapter{Number Systems}
\section{Introduction}
\section*{Exercise 2.1}
\section{Irrational Numbers}

Page -2

PAGE NO. 19
PAGE NO. 20

You might also like