The Programming Project Isc Computer Science Practical Specimen Paper Solved 2020 Question 1 Evil Number
The Programming Project Isc Computer Science Practical Specimen Paper Solved 2020 Question 1 Evil Number
Home ISC Computer Science Practical Solved ISC Computer Science Theory Programs ICSE JAVA Programs Project Euler Solutions
Telegram
Share
ISC COMPUTER SCIENCE PRACTICAL SPECIMEN PAPER SOLVED 2020 QUESTION 1 : Maths on Facebook
EVIL NUMBER Maths on YouTube
Maths
This particualr problem is quite simple. Going through the code will reveal the logic!
import java.util.*;
public class ISC2020Q1 {
public static void main(String[] args) {
int N;
Scanner in = new Scanner(System.in);
do {
System.out.println("Enter the number:");
N = in.nextInt(); Prime Maths
if(N <=2 || N>=100) मिहन्याभरापूवीर्
System.out.println("NUMBER OUT OF RANGE,TRY AGAIN");
Monotonicity of trigonometric function #IIT
}while(N <=2 || N>=100);
#WBJEE #CBSE
EvilNumber obj = new EvilNumber(N);
obj.dsiplay();
in.close();
}
}
Total Pageviews
class EvilNumber {
public void dsiplay() { 283,515
testEvilNumber();
System.out.println("INPUT NUMBER N:"+number);
System.out.println("BINARY EQUIVALENT:"); Followers
for(int i=1;i<=counter;i++)
System.out.print(binary[counter-i]+" ");
System.out.println();
System.out.println("NUMBER OF 1's:"+evil_counter);
if (flag==true)
System.out.print("EVIL NUMBER");
else
System.out.print("NOT AN EVIL NUMBER");
}
private void testEvilNumber() { Blog Archive
int tmp=number;
do { ► 2023 (23)
binary[counter] = tmp%2; ► 2022 (19)
tmp /=2;
► 2021 (22)
counter++;
}while(tmp >=1); ► 2020 (9)
for(int i=0;i<counter;i++) ▼ 2019 (31)
if(binary[i]==1) ▼ March (31)
evil_counter++;
ISC COMPUTER SCIENCE
PRACTICAL SOLVED 2006
if(evil_counter%2==0) QUESTIO...
flag=true;
ISC COMPUTER SCIENCE
} PRACTICAL 2005 SOLVED
EvilNumber(int N) { QUESTIO...
number = N; ISC COMPUTER SCIENCE
binary = new int[7]; // a binary sequence of length 7 ranges from 1 to 127 PRACTICAL 2005 SOLVED
counter = 0; QUESTIO...
evil_counter=0; ISC COMPUTER SCIENCE
flag = false; PRACTICAL 2004 SOLVED
} QUESTIO...
private boolean flag; ISC COMPUTER SCIENCE
private int number; PRACTICAL 2004 SOLVED
private int[] binary; QUESTIO...
private int counter; ISC COMPUTER SCIENCE
private int evil_counter; PRACTICAL 2020 SPECIMEN
} PAPER...
ISC COMPUTER SCIENCE
PRACTICAL 2020 SOLVED
SPECIME...
Posted by Vinod Singh at 7:08 AM
ISC COMPUTER SCIENCE
Labels: CBSE Computer Science, Computer, ISC COMPUTER SCIENCE PRACTICALS, isc java programs, Solved ISC papers PRACTICAL SPECIMEN PAPER
SOLV...
ISC COMPUTER SCIENCE
No comments: PRACTICAL 2003 SOLVED
QUESTIO...
► 2014 (87)
► 2013 (63)
► 2012 (7)
Powered by Blogger.