0% found this document useful (0 votes)
41 views2 pages

CL 8 Java Programming Output Questions 2024

This document is a practical exercise for Class VIII students at La Martiniere Girls' College, focusing on Java programming output questions. It includes various code snippets with expected outputs for students to fill in. The document is structured to help students understand Java syntax and output generation.

Uploaded by

Sanvi Sharma
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)
41 views2 pages

CL 8 Java Programming Output Questions 2024

This document is a practical exercise for Class VIII students at La Martiniere Girls' College, focusing on Java programming output questions. It includes various code snippets with expected outputs for students to fill in. The document is structured to help students understand Java syntax and output generation.

Uploaded by

Sanvi Sharma
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
You are on page 1/ 2

Name: ________________________________________ Date: __________________

Section: _____________ Roll No.: _______________

La Martiniere Girls’ College


Class VIII
Computer Science
Java Programming – Output Questions
System.out.print("Learning "); int a = 10, b = 5;
System.out.println("Java Programming."); int result = (a + b) * (a - b) / a;
System.out.print("It is "); System.out.println("Result: " + result);
System.out.print("fun and ");
System.out.println("challenging!");

Output – Output –

______________________________________ _________________________________________

______________________________________ _________________________________________

______________________________________ _________________________________________

______________________________________ _________________________________________

int a = 50, b = 25;


int m = 7;
System.out.println("Initial value of a = " + a);
int n = 9;
int temp = a / 5;
System.out.println(m + n);
a = a + 20;
System.out.println("7" + "9");
System.out.println("Updated value of a = " + a);
System.out.println("" + m + n);
int product = a * b;
System.out.println(7 + 9 + m + " " + n + m);
System.out.println("Value of temp is: " + temp);
System.out.println("Sum: " + m + n);
System.out.println("Value of product is: " +
System.out.println("Sum: " + (m + n));
product);

Output – Output –

______________________________________ _________________________________________
______________________________________ _________________________________________
______________________________________ _________________________________________
______________________________________ _________________________________________
______________________________________ _________________________________________
______________________________________ _________________________________________

LMGC/Cl 8/COMPUTER SCIENCE /Practical 3 Page 1 of 2


char a = '$' , b = '%'; int num = (20 + 30) * 2;
String u = "##Answer##"; String k = "45";
System.out.println(u); System.out.println( k + num );
System.out.print("1" ); System.out.println( "num" + num );
System.out.println(". " + a); System.out.println( num-10);
System.out.println("2. " + b); System.out.println( num-5 + "_" + k+5 );

Output – Output –

______________________________________ _________________________________________
______________________________________ _________________________________________
______________________________________ _________________________________________
______________________________________ _________________________________________

int a = 10, b = 30;


int x = 10, y = 25, z = 8, p, q, r; float a1 = (a + b) * 4;
p = (x - z) + 10; float a2 = (a + 22) % b;
y = y - 10; int b1 = (a + b) / 4;
q = x * y; int b2 = (a * a) + (b * b);
r = q - z; System.out.println("1) " + a1);
System.out.println("p= " + p); System.out.println("2) " + a2);
System.out.println("q= " + q); System.out.println("3) " + b1);
System.out.println("r= " + r); System.out.println("4) " + b2);

Output –- Output –

______________________________________ _________________________________________

______________________________________ _________________________________________

______________________________________ _________________________________________

______________________________________ _________________________________________

LMGC/Cl 8/COMPUTER SCIENCE /Practical 3 Page 2 of 2

You might also like