SlideShare a Scribd company logo
Find OUTPUT of The following Code
1 int i,k;
for(i=1,k=1;i<=5;k+=i,i++)
System.out.println(i+" "+k);
2 int x=5,y;
y=++x;
System.out.println(y);
3 int a = 25;
System.out.println(a++);
System.out.println(--a);
4 int x = 5, y=6, z;
z = x++ + ++y;
System.out.println(z);
5 int m=12;
int n = m++ * 5 + --m
System.out.println(n);
6 int y=14;
int z = (++y * (y++ + 5))
7 int x = 20, y = 5, z;
z = x > y ? 100 : 50;
System.out.println(z);
8 int x =25, y;
y = ++x % 6;
System.out.println(y);
9 int a = 10, b = 5, p;
p = a++ + ++b;
System.out.println(p+” “+a+” “+b);
10 for(int x = 1; x<=15; x+=2)
System.out.println(x);
11 int x = 5;
while(x>10)
{
System.out.println(x);
x++;
}
12 int a = 5;
do
{
System.out.println(a);
a++;
}while(a<4);
13 int k=5,j=9;
k+= k++ - ++j + k;
System.out.println(“k=”+k);
System.out.println(“j=”+j);
14 double b = -15.6;
double a = Math.rint(Math.abs(b));
System.out.println(“a=”+a);
15 State the number of times loop will be
executed and the final output :
int p = 200;
While(true)
{
if(p<100)
break;
p=p-20;
}
System.out.println(p);
16 int x = 1, y = 5;
while (x<y)
{
y++;
x+=2;
}
System.out.println(x+” “+y);
17 for(int x = 1; x<=20; x++)
{
if(x % 5 == 0)
continue;
System.out.println(x);
}
18 for(int x = 1; x<=20; x++)
{
if(x % 7 == 0)
break;
System.out.println(x);
}
19 int a = 25, b = 39;
while(b>0)
{
b = b – a;
a = a – b;
}
System.out.println(a + “ “+b);
20 for(int x=0;x<=15;x+=2);
System.out.println(x);
21 int a = 5, b = 7, c;
c = ++a + b++ + --a;
System.out.println(c);
22 int x = 20, y = 25;
x = ++x + y++ + --y + --x;
System.out.println(x);
23 int n = 2,m;
m = --n *2*n;
System.out.println(m);
24 int a = 25;
int b = (++a * 4) % 25;
System.out.println(b);
25 char c = ‘A’;
short m = 26;
int n = c + m;
System.out.println(n);
26 What will be the value of following expression
if the value of m = 5 and n=20?
(m + n) > 25 ? 200 : 20;
27 Int x = 99, y = 10;
y = ++x;
System.out.println(“X:”+x+” Y:”+y);
28 double x = 0.055,y = 100.05;
System.out.println((int)(x*y));
29 int x = 10, y=15;
x = x+y;
y = x-y;
x = x-y;
System.out.println(x+ “ *** ”+y);
30 int sum = 20;
if(sum<20)
System.out.print(“Under ”);
else
System.out.println(“Over “);
System.out.println(“the limit”);
31 What will be the output, if n = 1 and if n= 2 in
the following code?
switch(n)
{
case 1:
System.out.println(“One);
break;
case 2:
System.out.println(“ Zero”);
default:
System.out.println(“Wrong input”);
}
32 int s=1,p=0;
for(int j = 1;j<=8;j++)
{
if(j<=4)
s*=j;
else
p+=j;
}
System.out.println(s+” “+p);
33 If array[]={1,9,8,5,2};
i) What is array.length?
ii) What is array[2]?
34 int x[]={1,2,3,4,5}, y ={5,4,3,2,1};
int i,j;
for(i=0,j=x.length;i<x.length;i++,j- -)
System.out.println(x[i] * y[j]);
35 String s = “Please come, let us go to play”;
System.out.println (s.substring(7,11));
System.out.println (s.lastIndexOf(‘o’));
System.out.println (s.toUpperCase());
System.out.println (s.charAt(17));
System.out.println (s.indexOf(9,’o’));
System.out.println (s.substring(0,6) +
s.substring(20,22));
36 Sting k=”WELCOME TOPPERS”
System.out.println(k.toLowerCase());
System.out.println(k.length());
System.out.println(k.indexOf(‘E’));
System.out.println(k.replace(‘O’,’A’));
System.out.println(k.substring(8));
37 String n = “Computer Knowledge.”;
String m = “Computer Application”;
System.out.println
(n.substring(0,8).concat (m.substring(9)));
System.out.println(n.endsWith(“e”);
38 System.out.println(“Four:”+(4+2));
System.out.println(“Four:”+2+2);
39 State the output of the following code
fragment, where int choice =1, x= 0;
y = 0, z=0;
switch(choice++)
{
case 2: x++; y--; z++;
break;
case 3: x+=2; y+=3; z-=3;
default: ++x; ++y; ++z;
}
System.out.println(“X=”+x+”Y =”+y+”Z=”+z);
Questions to practice to find LOGICAL and SYNTAX error in the code
1. public int getData(int num1, int num2)
{
int result = num1 + num2;
System.out.println(“Result is :” +
result);
}
2. class Add
{
public void doAddition(int x, y)
{
System.out.print(x+y);
}
}
3. if(x = 1)
k=100;
else
k = 10;
4. if ( x > y)
System.out. println(“y is greater”);
else
System.out. println(“x is greater”);
5. int i=5, j = 10
if ( (i < j) || (i=10))
System.out.println(“OK”);
System.out.println(“not OK);
6. int x=0;
while(x < 10)
System.out.println(x);
x ++;
7. for ( x = 0; x>= 10; x- -)
System.out.println(x);
8. for (i = 0, i <= 25; i ++)
System.out.println(i);
System.out.println(“the value is “;x);
9. public int add(int x,int y)
{
int z=x + y;
}
10. int a = 5 , b = 7 , c = 1;
if (a > b || b > c)
System.out.println(a + “ is greater”);
11. int a =90, b = 45, c = 45
if(a = = 90 && b = = 90 && c = = 90)
System.out.println(“Right angle
Triangle”);
12. double p =1000.00, t = 5.0, r = 10.5;
I = p * r * t / 100;
System.out.println(I);
13. double average = M1+M2+M3+M4 / 4;
14. String s = ‘computer’;
15. int l = “Good Morning”.length;
16. for (int x = 1; x < = 10 ; x++)
{
n = 1;
System.out.println(n);
n++;
}
correct the code to get 1 3 5 7 9 11 13
15 17 19 output.
17. int x, y, z;
x = 6;
y = 7;
x + y = z;
System.out.println(z);
18. int a[] = new int [10];
for( x =1 ; x<=15 ; x++)
a[x] = x * x;
19. int n = integer.ParseInt(br.readline());
20. String st = “School”;
System.out.println(st.reverse( ));
21. int x = 5, y = 8, temp;
temp = x;
x = y;
y = temp;
System.out.println(x, y, temp);
22. int x[ ] = [3,6,8,4,7,0,4,1,5];
23. int ar[ ] = [3,6,8,4,7,0,4,1,5];
System.out.println(ar.length());
Express the following in Java expression
(1-y3
)0.5
√ (x2 – x1)2
+ (y2 - y1)2
–b + (b2
-4ac)/2a
3x2
+2y [2011]
x - y
(x2
- 2y2
)3
(1 + x4
)0.25
a = (0.05 – 2y3
)/x - y
A3
+ B3
+ C3
– 3ABC
x1/3
√ l2
+ b2
x – [ y – {+ (a + b – c – d)}]
3x2
y+2yx2
( x – y)0.5
s = ut + ½at2
(a + b)n
√3 + b
√ 2as + u2
(2012)
5x * 7 – 5x
5x+2
– 5x+1
2AB + 2BC + 2CA
X2Y2 + Y2Z2 + Z2 + X2
Find the output of the following code (Java for ICSE)
Ad

More Related Content

What's hot (20)

Informatics Practices class XI
Informatics Practices class XIInformatics Practices class XI
Informatics Practices class XI
Harshit Saini
 
Acknowledgement
AcknowledgementAcknowledgement
Acknowledgement
Utkarsh0825
 
Ip project
Ip projectIp project
Ip project
Jasmeet Singh
 
Chapter 02 functions -class xii
Chapter 02   functions -class xiiChapter 02   functions -class xii
Chapter 02 functions -class xii
Praveen M Jigajinni
 
causes for 1857 revolt
causes for 1857 revoltcauses for 1857 revolt
causes for 1857 revolt
Hema Krishnamurthy
 
The Mauryan Empire
The Mauryan EmpireThe Mauryan Empire
The Mauryan Empire
Suhas Mandlik
 
Moore Mealy Machine Conversion
Moore Mealy Machine Conversion Moore Mealy Machine Conversion
Moore Mealy Machine Conversion
Aiman Hafeez
 
ICSE CLASS 10 | TOP 30 MOST IMPORTANT MCQ QUESTIONS | COMPUTER APPLICATIONS |
ICSE CLASS 10 | TOP 30 MOST IMPORTANT MCQ QUESTIONS | COMPUTER APPLICATIONS |ICSE CLASS 10 | TOP 30 MOST IMPORTANT MCQ QUESTIONS | COMPUTER APPLICATIONS |
ICSE CLASS 10 | TOP 30 MOST IMPORTANT MCQ QUESTIONS | COMPUTER APPLICATIONS |
AKASHCHAUDHARY324120
 
Types of grammer - TOC
Types of grammer - TOCTypes of grammer - TOC
Types of grammer - TOC
AbhayDhupar
 
ICSE Geography Map Class X.pdf
ICSE Geography Map Class X.pdfICSE Geography Map Class X.pdf
ICSE Geography Map Class X.pdf
Gauri S
 
Chapter 7 history CBSE
Chapter 7 history CBSEChapter 7 history CBSE
Chapter 7 history CBSE
SakthivelSwamy
 
The revolt of 1857
The revolt of 1857The revolt of 1857
The revolt of 1857
Arnav Bansal
 
Multi Head, Multi Tape Turing Machine
Multi Head, Multi Tape Turing MachineMulti Head, Multi Tape Turing Machine
Multi Head, Multi Tape Turing Machine
Radhakrishnan Chinnusamy
 
Early states and economy (c.600 BCE-600 CE)
Early states and economy (c.600 BCE-600 CE)Early states and economy (c.600 BCE-600 CE)
Early states and economy (c.600 BCE-600 CE)
MD Hadees
 
Revolt of 1857 class 8 History cbse
Revolt of 1857 class 8 History cbseRevolt of 1857 class 8 History cbse
Revolt of 1857 class 8 History cbse
A. ABDUL SHUMZ, Kendriya Vidyalaya Kanjikode
 
Practical File of C Language
Practical File of C LanguagePractical File of C Language
Practical File of C Language
RAJWANT KAUR
 
TOC 1 | Introduction to Theory of Computation
TOC 1 | Introduction to Theory of ComputationTOC 1 | Introduction to Theory of Computation
TOC 1 | Introduction to Theory of Computation
Mohammad Imam Hossain
 
Picture connection 2
Picture connection 2Picture connection 2
Picture connection 2
Pritam Ghoshal
 
Accountancy project class 11
Accountancy project class 11Accountancy project class 11
Accountancy project class 11
kratikjain5
 
Types of Language in Theory of Computation
Types of Language in Theory of ComputationTypes of Language in Theory of Computation
Types of Language in Theory of Computation
Ankur Singh
 
Informatics Practices class XI
Informatics Practices class XIInformatics Practices class XI
Informatics Practices class XI
Harshit Saini
 
Moore Mealy Machine Conversion
Moore Mealy Machine Conversion Moore Mealy Machine Conversion
Moore Mealy Machine Conversion
Aiman Hafeez
 
ICSE CLASS 10 | TOP 30 MOST IMPORTANT MCQ QUESTIONS | COMPUTER APPLICATIONS |
ICSE CLASS 10 | TOP 30 MOST IMPORTANT MCQ QUESTIONS | COMPUTER APPLICATIONS |ICSE CLASS 10 | TOP 30 MOST IMPORTANT MCQ QUESTIONS | COMPUTER APPLICATIONS |
ICSE CLASS 10 | TOP 30 MOST IMPORTANT MCQ QUESTIONS | COMPUTER APPLICATIONS |
AKASHCHAUDHARY324120
 
Types of grammer - TOC
Types of grammer - TOCTypes of grammer - TOC
Types of grammer - TOC
AbhayDhupar
 
ICSE Geography Map Class X.pdf
ICSE Geography Map Class X.pdfICSE Geography Map Class X.pdf
ICSE Geography Map Class X.pdf
Gauri S
 
Chapter 7 history CBSE
Chapter 7 history CBSEChapter 7 history CBSE
Chapter 7 history CBSE
SakthivelSwamy
 
The revolt of 1857
The revolt of 1857The revolt of 1857
The revolt of 1857
Arnav Bansal
 
Early states and economy (c.600 BCE-600 CE)
Early states and economy (c.600 BCE-600 CE)Early states and economy (c.600 BCE-600 CE)
Early states and economy (c.600 BCE-600 CE)
MD Hadees
 
Practical File of C Language
Practical File of C LanguagePractical File of C Language
Practical File of C Language
RAJWANT KAUR
 
TOC 1 | Introduction to Theory of Computation
TOC 1 | Introduction to Theory of ComputationTOC 1 | Introduction to Theory of Computation
TOC 1 | Introduction to Theory of Computation
Mohammad Imam Hossain
 
Accountancy project class 11
Accountancy project class 11Accountancy project class 11
Accountancy project class 11
kratikjain5
 
Types of Language in Theory of Computation
Types of Language in Theory of ComputationTypes of Language in Theory of Computation
Types of Language in Theory of Computation
Ankur Singh
 

Similar to Find the output of the following code (Java for ICSE) (20)

Review questions and answers
Review questions and answersReview questions and answers
Review questions and answers
IIUM
 
Ann
AnnAnn
Ann
micro536
 
MineSweeper.java public class MS { public static void main(Strin.pdf
MineSweeper.java public class MS { public static void main(Strin.pdfMineSweeper.java public class MS { public static void main(Strin.pdf
MineSweeper.java public class MS { public static void main(Strin.pdf
aniyathikitchen
 
Java file
Java fileJava file
Java file
simarsimmygrewal
 
Java file
Java fileJava file
Java file
simarsimmygrewal
 
.net progrmming part2
.net progrmming part2.net progrmming part2
.net progrmming part2
Dr.M.Karthika parthasarathy
 
Program for hamming code using c
Program for hamming code using cProgram for hamming code using c
Program for hamming code using c
snsanth
 
03review
03review03review
03review
IIUM
 
BCSL 058 solved assignment
BCSL 058 solved assignmentBCSL 058 solved assignment
BCSL 058 solved assignment
Indira Gnadhi National Open University (IGNOU)
 
Vcs5
Vcs5Vcs5
Vcs5
Malikireddy Bramhananda Reddy
 
ADA FILE
ADA FILEADA FILE
ADA FILE
Gaurav Singh
 
201707 CSE110 Lecture 13
201707 CSE110 Lecture 13   201707 CSE110 Lecture 13
201707 CSE110 Lecture 13
Javier Gonzalez-Sanchez
 
ch05-program-logic-indefinite-loops.ppt
ch05-program-logic-indefinite-loops.pptch05-program-logic-indefinite-loops.ppt
ch05-program-logic-indefinite-loops.ppt
Mahyuddin8
 
Go vs C++ - CppRussia 2019 Piter BoF
Go vs C++ - CppRussia 2019 Piter BoFGo vs C++ - CppRussia 2019 Piter BoF
Go vs C++ - CppRussia 2019 Piter BoF
Timur Safin
 
Los dskn
Los dsknLos dskn
Los dskn
Brenda Jazmin
 
Let us C (by yashvant Kanetkar) chapter 3 Solution
Let us C   (by yashvant Kanetkar) chapter 3 SolutionLet us C   (by yashvant Kanetkar) chapter 3 Solution
Let us C (by yashvant Kanetkar) chapter 3 Solution
Hazrat Bilal
 
QA Auotmation Java programs,theory
QA Auotmation Java programs,theory QA Auotmation Java programs,theory
QA Auotmation Java programs,theory
archana singh
 
Network lap pgms 7th semester
Network lap pgms 7th semesterNetwork lap pgms 7th semester
Network lap pgms 7th semester
DOSONKA Group
 
Sparse Matrix and Polynomial
Sparse Matrix and PolynomialSparse Matrix and Polynomial
Sparse Matrix and Polynomial
Aroosa Rajput
 
UNIT 2 LOOP CONTROL.pptx
UNIT 2 LOOP CONTROL.pptxUNIT 2 LOOP CONTROL.pptx
UNIT 2 LOOP CONTROL.pptx
Abhishekkumarsingh630054
 
Ad

Recently uploaded (20)

From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint PresentationFrom Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
Shay Ginsbourg
 
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with PrometheusMeet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Eric D. Schabell
 
Navigating EAA Compliance in Testing.pdf
Navigating EAA Compliance in Testing.pdfNavigating EAA Compliance in Testing.pdf
Navigating EAA Compliance in Testing.pdf
Applitools
 
Autodesk Inventor Crack (2025) Latest
Autodesk Inventor    Crack (2025) LatestAutodesk Inventor    Crack (2025) Latest
Autodesk Inventor Crack (2025) Latest
Google
 
🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf
🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf
🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf
Imma Valls Bernaus
 
Download MathType Crack Version 2025???
Download MathType Crack  Version 2025???Download MathType Crack  Version 2025???
Download MathType Crack Version 2025???
Google
 
Change Management Models and Tools for Organizational Transformation
Change Management Models and Tools for Organizational TransformationChange Management Models and Tools for Organizational Transformation
Change Management Models and Tools for Organizational Transformation
EHA Soft Solutions
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
Gojek Clone App for Multi-Service Business
Gojek Clone App for Multi-Service BusinessGojek Clone App for Multi-Service Business
Gojek Clone App for Multi-Service Business
XongoLab Technologies LLP
 
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
saimabibi60507
 
Wilcom Embroidery Studio Crack 2025 For Windows
Wilcom Embroidery Studio Crack 2025 For WindowsWilcom Embroidery Studio Crack 2025 For Windows
Wilcom Embroidery Studio Crack 2025 For Windows
Google
 
Why Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card ProvidersWhy Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card Providers
Tapitag
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdfProtect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
株式会社クライム
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Innovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at allInnovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at all
ayeshakanwal75
 
Effortless SMS Blasts from Salesforce with Message Blink — No Tab Switching!
Effortless SMS Blasts from Salesforce with Message Blink — No Tab Switching!Effortless SMS Blasts from Salesforce with Message Blink — No Tab Switching!
Effortless SMS Blasts from Salesforce with Message Blink — No Tab Switching!
Message Blink
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
OnePlan Solutions
 
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint PresentationFrom Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
From Vibe Coding to Vibe Testing - Complete PowerPoint Presentation
Shay Ginsbourg
 
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with PrometheusMeet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Meet the New Kid in the Sandbox - Integrating Visualization with Prometheus
Eric D. Schabell
 
Navigating EAA Compliance in Testing.pdf
Navigating EAA Compliance in Testing.pdfNavigating EAA Compliance in Testing.pdf
Navigating EAA Compliance in Testing.pdf
Applitools
 
Autodesk Inventor Crack (2025) Latest
Autodesk Inventor    Crack (2025) LatestAutodesk Inventor    Crack (2025) Latest
Autodesk Inventor Crack (2025) Latest
Google
 
🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf
🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf
🌱 Green Grafana 🌱 Essentials_ Data, Visualizations and Plugins.pdf
Imma Valls Bernaus
 
Download MathType Crack Version 2025???
Download MathType Crack  Version 2025???Download MathType Crack  Version 2025???
Download MathType Crack Version 2025???
Google
 
Change Management Models and Tools for Organizational Transformation
Change Management Models and Tools for Organizational TransformationChange Management Models and Tools for Organizational Transformation
Change Management Models and Tools for Organizational Transformation
EHA Soft Solutions
 
Societal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainabilitySocietal challenges of AI: biases, multilinguism and sustainability
Societal challenges of AI: biases, multilinguism and sustainability
Jordi Cabot
 
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
PRTG Network Monitor Crack Latest Version & Serial Key 2025 [100% Working]
saimabibi60507
 
Wilcom Embroidery Studio Crack 2025 For Windows
Wilcom Embroidery Studio Crack 2025 For WindowsWilcom Embroidery Studio Crack 2025 For Windows
Wilcom Embroidery Studio Crack 2025 For Windows
Google
 
Why Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card ProvidersWhy Tapitag Ranks Among the Best Digital Business Card Providers
Why Tapitag Ranks Among the Best Digital Business Card Providers
Tapitag
 
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRYLEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
LEARN SEO AND INCREASE YOUR KNOWLDGE IN SOFTWARE INDUSTRY
NidaFarooq10
 
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdfProtect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
Protect HPE VM Essentials using Veeam Agents-a50012338enw.pdf
株式会社クライム
 
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Lionel Briand
 
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
F-Secure Freedome VPN 2025 Crack Plus Activation  New VersionF-Secure Freedome VPN 2025 Crack Plus Activation  New Version
F-Secure Freedome VPN 2025 Crack Plus Activation New Version
saimabibi60507
 
Innovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at allInnovative Approaches to Software Dev no good at all
Innovative Approaches to Software Dev no good at all
ayeshakanwal75
 
Effortless SMS Blasts from Salesforce with Message Blink — No Tab Switching!
Effortless SMS Blasts from Salesforce with Message Blink — No Tab Switching!Effortless SMS Blasts from Salesforce with Message Blink — No Tab Switching!
Effortless SMS Blasts from Salesforce with Message Blink — No Tab Switching!
Message Blink
 
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
Interactive odoo dashboards for sales, CRM , Inventory, Invoice, Purchase, Pr...
AxisTechnolabs
 
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
Surviving a Downturn Making Smarter Portfolio Decisions with OnePlan - Webina...
OnePlan Solutions
 
Ad

Find the output of the following code (Java for ICSE)

  • 1. Find OUTPUT of The following Code 1 int i,k; for(i=1,k=1;i<=5;k+=i,i++) System.out.println(i+" "+k); 2 int x=5,y; y=++x; System.out.println(y); 3 int a = 25; System.out.println(a++); System.out.println(--a); 4 int x = 5, y=6, z; z = x++ + ++y; System.out.println(z); 5 int m=12; int n = m++ * 5 + --m System.out.println(n); 6 int y=14; int z = (++y * (y++ + 5)) 7 int x = 20, y = 5, z; z = x > y ? 100 : 50; System.out.println(z); 8 int x =25, y; y = ++x % 6; System.out.println(y); 9 int a = 10, b = 5, p; p = a++ + ++b; System.out.println(p+” “+a+” “+b); 10 for(int x = 1; x<=15; x+=2) System.out.println(x); 11 int x = 5; while(x>10) { System.out.println(x); x++; } 12 int a = 5; do { System.out.println(a); a++; }while(a<4); 13 int k=5,j=9; k+= k++ - ++j + k; System.out.println(“k=”+k); System.out.println(“j=”+j); 14 double b = -15.6; double a = Math.rint(Math.abs(b)); System.out.println(“a=”+a); 15 State the number of times loop will be executed and the final output : int p = 200; While(true) { if(p<100) break; p=p-20; } System.out.println(p); 16 int x = 1, y = 5; while (x<y) { y++; x+=2; } System.out.println(x+” “+y); 17 for(int x = 1; x<=20; x++) { if(x % 5 == 0) continue; System.out.println(x); } 18 for(int x = 1; x<=20; x++) { if(x % 7 == 0) break; System.out.println(x); } 19 int a = 25, b = 39; while(b>0) { b = b – a; a = a – b; } System.out.println(a + “ “+b); 20 for(int x=0;x<=15;x+=2); System.out.println(x); 21 int a = 5, b = 7, c; c = ++a + b++ + --a; System.out.println(c); 22 int x = 20, y = 25; x = ++x + y++ + --y + --x; System.out.println(x); 23 int n = 2,m; m = --n *2*n; System.out.println(m); 24 int a = 25; int b = (++a * 4) % 25; System.out.println(b); 25 char c = ‘A’; short m = 26; int n = c + m; System.out.println(n); 26 What will be the value of following expression if the value of m = 5 and n=20? (m + n) > 25 ? 200 : 20;
  • 2. 27 Int x = 99, y = 10; y = ++x; System.out.println(“X:”+x+” Y:”+y); 28 double x = 0.055,y = 100.05; System.out.println((int)(x*y)); 29 int x = 10, y=15; x = x+y; y = x-y; x = x-y; System.out.println(x+ “ *** ”+y); 30 int sum = 20; if(sum<20) System.out.print(“Under ”); else System.out.println(“Over “); System.out.println(“the limit”); 31 What will be the output, if n = 1 and if n= 2 in the following code? switch(n) { case 1: System.out.println(“One); break; case 2: System.out.println(“ Zero”); default: System.out.println(“Wrong input”); } 32 int s=1,p=0; for(int j = 1;j<=8;j++) { if(j<=4) s*=j; else p+=j; } System.out.println(s+” “+p); 33 If array[]={1,9,8,5,2}; i) What is array.length? ii) What is array[2]? 34 int x[]={1,2,3,4,5}, y ={5,4,3,2,1}; int i,j; for(i=0,j=x.length;i<x.length;i++,j- -) System.out.println(x[i] * y[j]); 35 String s = “Please come, let us go to play”; System.out.println (s.substring(7,11)); System.out.println (s.lastIndexOf(‘o’)); System.out.println (s.toUpperCase()); System.out.println (s.charAt(17)); System.out.println (s.indexOf(9,’o’)); System.out.println (s.substring(0,6) + s.substring(20,22)); 36 Sting k=”WELCOME TOPPERS” System.out.println(k.toLowerCase()); System.out.println(k.length()); System.out.println(k.indexOf(‘E’)); System.out.println(k.replace(‘O’,’A’)); System.out.println(k.substring(8)); 37 String n = “Computer Knowledge.”; String m = “Computer Application”; System.out.println (n.substring(0,8).concat (m.substring(9))); System.out.println(n.endsWith(“e”); 38 System.out.println(“Four:”+(4+2)); System.out.println(“Four:”+2+2); 39 State the output of the following code fragment, where int choice =1, x= 0; y = 0, z=0; switch(choice++) { case 2: x++; y--; z++; break; case 3: x+=2; y+=3; z-=3; default: ++x; ++y; ++z; } System.out.println(“X=”+x+”Y =”+y+”Z=”+z); Questions to practice to find LOGICAL and SYNTAX error in the code 1. public int getData(int num1, int num2) { int result = num1 + num2; System.out.println(“Result is :” + result); } 2. class Add { public void doAddition(int x, y) { System.out.print(x+y); } } 3. if(x = 1) k=100; else k = 10; 4. if ( x > y) System.out. println(“y is greater”); else System.out. println(“x is greater”); 5. int i=5, j = 10 if ( (i < j) || (i=10)) System.out.println(“OK”); System.out.println(“not OK); 6. int x=0; while(x < 10) System.out.println(x); x ++; 7. for ( x = 0; x>= 10; x- -) System.out.println(x); 8. for (i = 0, i <= 25; i ++) System.out.println(i); System.out.println(“the value is “;x);
  • 3. 9. public int add(int x,int y) { int z=x + y; } 10. int a = 5 , b = 7 , c = 1; if (a > b || b > c) System.out.println(a + “ is greater”); 11. int a =90, b = 45, c = 45 if(a = = 90 && b = = 90 && c = = 90) System.out.println(“Right angle Triangle”); 12. double p =1000.00, t = 5.0, r = 10.5; I = p * r * t / 100; System.out.println(I); 13. double average = M1+M2+M3+M4 / 4; 14. String s = ‘computer’; 15. int l = “Good Morning”.length; 16. for (int x = 1; x < = 10 ; x++) { n = 1; System.out.println(n); n++; } correct the code to get 1 3 5 7 9 11 13 15 17 19 output. 17. int x, y, z; x = 6; y = 7; x + y = z; System.out.println(z); 18. int a[] = new int [10]; for( x =1 ; x<=15 ; x++) a[x] = x * x; 19. int n = integer.ParseInt(br.readline()); 20. String st = “School”; System.out.println(st.reverse( )); 21. int x = 5, y = 8, temp; temp = x; x = y; y = temp; System.out.println(x, y, temp); 22. int x[ ] = [3,6,8,4,7,0,4,1,5]; 23. int ar[ ] = [3,6,8,4,7,0,4,1,5]; System.out.println(ar.length()); Express the following in Java expression (1-y3 )0.5 √ (x2 – x1)2 + (y2 - y1)2 –b + (b2 -4ac)/2a 3x2 +2y [2011] x - y (x2 - 2y2 )3 (1 + x4 )0.25 a = (0.05 – 2y3 )/x - y A3 + B3 + C3 – 3ABC x1/3 √ l2 + b2 x – [ y – {+ (a + b – c – d)}] 3x2 y+2yx2 ( x – y)0.5 s = ut + ½at2 (a + b)n √3 + b √ 2as + u2 (2012) 5x * 7 – 5x 5x+2 – 5x+1 2AB + 2BC + 2CA X2Y2 + Y2Z2 + Z2 + X2