Ouput_Program
Ouput_Program
(GOVT.REGD.)
MCA, BCA, B.TECH and Others (Programming Only and Practical Based)
Full Marks: - 60
Question 1
Given: int m=5; m*=5 then the value stored in m results in 55.
Question 5
Question 1
ab+cd33ab+cd
Question 2
p3+q4−12rp3+q4−21r
Question 3
−b+b2−4ac2a2a−b+b2−4ac
Question 4
Centre at-Baguiati, Jyangra, Teghoria, Manicktalla, Khanna
79802 96633
MAHADEVI EDUCATON ACADEMY
(GOVT.REGD.)
MCA, BCA, B.TECH and Others (Programming Only and Practical Based)
0.05−2y3(x−y)(x−y)0.05−2y3
Question 5
mn+(m+n)3mn+3(m+n)
Question 1
Question 2
Question 3
int x = 90;
char c = (x<=90)? 'Z' : 'I';
Question 4
Question 5
Question 1
What is an operator? What are the three main types of operators? Name them.
Question 2
Question 3
79802 96633
MAHADEVI EDUCATON ACADEMY
(GOVT.REGD.)
MCA, BCA, B.TECH and Others (Programming Only and Practical Based)
Question 4
Distinguish between:
Question 5
int k=5,j=9;
k += k++ - ++j + k;
System.out.println ("k="+k);
System.out.println ("j="+j);
Question 6
Question 7
Question 8
Question 9
Rewrite the following program segment using if-else statements instead of the ternary operator.
(e) c = (x >= 'A' && x <= 'Z') ? "Upper Case Letter" : "Lower Case Letter";
Question 10
79802 96633
MAHADEVI EDUCATON ACADEMY
(GOVT.REGD.)
MCA, BCA, B.TECH and Others (Programming Only and Practical Based)
(a)
if (x % 2 == 0)
System.out.println("Even");
else
System.out.println("Odd");
(c)
tax = 0;
else
tax = 12;
(e)
if (p >= 4750)
k = p * 5 / 100;
else
k = p * 10 / 100;
Program 1
An Evil number is a positive whole number which has even number of 1's in its binary
equivalent. Example: Binary equivalent of 9 is 1001, which contains even number of 1's. A few
evil numbers are 3, 5, 6, 9…. Design a program to accept a positive whole number and find the
binary equivalent of the number and count the number of 1's in it and display whether it is a
Evil number or not with an appropriate message. Output the result in format given below:
Example 1
Input: 15
Binary Equivalent: 1111
No. of 1's: 4
Output: Evil Number
Example 2
Input: 26
79802 96633
MAHADEVI EDUCATON ACADEMY
(GOVT.REGD.)
MCA, BCA, B.TECH and Others (Programming Only and Practical Based)
Program 2
A tech number has even number of digits. If the number is split in two equal halves, then the
square of sum of these halves is equal to the number itself. Write a program to generate and
print all four digits tech numbers.
Example:
Program 3
Write a program to input a number and find whether the number is an emirp number or not. A number is said to
be emirp if the original number and the reversed number both are prime numbers.
For example, 17 is an emirp number as 17 and its reverse 71 are both prime numbers.
79802 96633