Loading....
Tuesday, 30 April 2019
Aptitude Hack#66(30-4-19)

Question:
A zookeeper counted the heads of the animals in a zoo and found it to be 80. When he counted the legs of the animals he found it to be 260. If the zoo had either pigeons or horses, how many horses were there in the zoo?
A) 40
B) 30
C) 50
D) 60
E) None of These
CLICK...
Monday, 29 April 2019
Aptitude Hack#65(29-4-19)

Question:
If 13:11 is the ratio of the present age of Jothi and Viji respectively and 15:9 is the ratio between Jothi's age 4 years hence and Viji's age 4 years ago. Then what will be the ratio of Jothi's age 4 years ago and Viji's age 4 years hence?
A) 15: 9
B) ...
Sunday, 28 April 2019
IOPP Program No.7. A
Program No.7. A
Create a LATEX document to demonstrate the paragraph justification
(left, center, right) and creating the tables.
Solution:
\documentclass{article}
\begin{document}
Hi all... I'm new to Perl.
\flushleft Hi, all... I'm new to Perl.
\center Hi, all... I'm new to Perl.
\flushright Hi, all... I'm new to Perl.
\begin{center}
\begin{tabular}{|l|c|r|}\hline
left¢er&right...
IOPP Program No.3.A
Program No.3.A
Write an OpenMP program (for shared memory multiprocessor
architecture) to sort the given list of numbers using Radix Sort. Display
the appropriate environment variables to demonstrate parallel
programming.
Solution:
#include <stdio.h>
#include<omp.h>
int
main ()
{
int b, i, j, p, q, d, z = 9, digit...
IOPP Program No.6. A
Program No.6. A
Write an OpenMP program (for shared memory multiprocessor
architecture) to multiply the two matrices using the brute force approach.
Display the appropriate environment variables to demonstrate parallel
programming.
Solution:
#include <stdio.h>
#include<omp.h>
int main()
{
int r1, r2, c1, c2, i, j, k,tid,nthreads,chunk=10;
...
IOPP Program No.4. A
Program No.4. A
Write an OpenMP program (for shared memory multiprocessor
architecture) to multiply two matrices using Strassen’s Multiplication
technique. Display the appropriate environment variables to demonstrate
parallel programming.
Solution:
#include<stdio.h>
int main(){
int a[2][2],b[2][2],c[2][2],i,j;
int...
IOPP Program No.8.B
Program No.8.B
Write a Perl script to convert the decimal number to binary number
Solution:
print"Enter a number to convert : ";
$num=<STDIN>;
$intnum=sprintf("%d",$num);
$i=0;
while($intnum>0)
{
$array[$i]=$intnum%2;
$intnum=int($intnum/2);
$i=$i+1;
}
print...
IOPP Program No.7.B
Program No.7.B
Write a Perl script to find the highest marks of a subject. The marks of
different subject along with the names of the students are maintained in
a “result.txt” file.
Solution:
#!/usr/bin/perl
$filename="result.txt";
open(filedesc,$filename) or die "File can't be opened.";
$maxphy=0;
$maxchem=0;
$maxmath=0;
while(<filedesc>)
{
...
IOPP Program No.6.B
Program No.6.B
Write a Perl script to copy the contents of one file to another file.
Solution:
open(file1,"<source.txt");
open(file2,">destination.txt");
open(file3,">>appendfile.txt");
while(<file1>)
{
print file2 $_;
print $_;
print file3 $_;
}
...
IOPP Program No.5.B
Program No.5.B
Write a Perl script to find the average marks of each subject. The marks
of the different subject along with the names of the students are maintained
in a “result.txt” file.
Solution:
#!/usr/bin/perl
$filename="result.txt";
open(filedesc,$filename) or die "Can't open file.";
$avg=0;
$n=0;
$phytotal=0;
$chemtotal=0;
$mathtotal=0;
while(<filedesc>)
{
...
IOPP Program No.4.B
Program No.4.B
Write a shell script that displays “Good morning”, “Good afternoon” or
“Good evening”, depending upon the time at which the user logs in.
Solution:
echo "Greeting of the day."
x=`date | cut -c 12-13`
echo $x
y=`date | cut -c 12-16`
echo $y
if [ $x -ge 0 ] && [ $x -lt 10 ]
then
echo "Good morning."
elif...
IOPP Program No.3. B
Program No.3. B
Write a shell script to display the lines of a given file. The line numbers
are specified as a range. For example, if the range specified is 10-25,
then the lines from 10 to 25 of the file are to be displayed.
Solution:
echo "Enter the filename."
read filename
echo "Enter the starting line."
read x
echo "Enter the ending...
IOPP Program No.2.B
Program No.2.B
Write a shell script to check whether a number is a palindrome or not.
Solution:
echo "Enter a number."
read n
p=$n
sd=0
rev=0
while [ $n -gt 0 ]
do
sd=$(( $n % 10 ))
rev=`expr $rev \* 10 + $sd`
n=$(( $n / 10 ))
done
if [ $p -eq $rev ]
then
echo "Palindrome."
else
echo "Not Palind...
IOPP Program No.2.A
Program No.2.
a)
Write OpenMP program (for shared memory multiprocessor architecture)
to sort the given list of names using Bubble Sort. Display the
appropriate environment variables to demonstrate parallel programming.
Solution:
#include<stdio.h>
#include<stdlib.h>
#include<omp.h>
#include<string.h>
int main(int argc,char...
IOPP Program No.1.B
Program No.1.B
Write a shell script to determine the type of triangle.
Solution:
echo "Enter the first side of the triangle."
read x
echo "Enter the second side of the triangle."
read y
echo "Enter the third side of the triangle."
read z
if [ $x -eq $y ] && [ $y -eq $z ]
then
echo "Equilateral triangle."
elif [...
IOPP Program NO.1 A
Program No.1.A
Demonstrate the following coding standards by writing a C program to
evaluate a postfix evaluation:
1. Naming convention.
2. Active Names for functions.
3. Consistent indentations and brace styles.
4. Proper parenthesizing to resolve the ambiguity.
5. Proper documentation.
Solution:
#include<stdio.h>
struct...
Aptitude Hack#64(28-4-19)

Question:
The price of 2 sarees and 4 shirts is Rs. 1600. With the same money, one can buy 1 saree and 6 shirts. If one wants to buy 12 shirts, how much shall he have to pay?
A. Rs. 1200
B. Rs. 2400
C. Rs. 4800
D. Cannot be determined
E. None of thes...
Saturday, 27 April 2019
Tricky Interview#2
Question:
Write a function that moves the last element to the front in a given Singly Linked List.
For example:
Input Linked List is 1->2->3->4->5.
Output Linked List 5->1->2->3->4.
Solution:
Link:https://javaabhigyan.blogspot.com/2019/04/move-last-element-to-front-of-given.htm...
Move last element to front of a given Linked List
April 27, 2019C interview Question, C Theory Question, Move last element to front of a given Linked List, Technical Round, Tricky Interview QuestionNo comments
Question:
Write a function that moves the last element to the front in a given Singly Linked List.
For example:
Input: 1->2->3->4->5
Output: 5->1->2->3->4.
Algorithm:
Traverse the list till the last node. Use two pointers: one to store the address of the last node and other for the address of the second last node....
Aptitude Hack#63(27-4-19)

Question:
A hollow iron pipe is 21 cm long and its external diameter is 8 cm. If the thickness of the pipe is 1 cm and iron weighs 8 g/cm3, then the weight of the pipe is:
A. 3.6 kg
B. 3.696 kg
C. 36 kg
D. 36.9 k...
Friday, 26 April 2019
Aptitude Hack#62(26-4-19)

Question:
A bag contains 4 white, 5 red, and 6 blue balls. Three balls are drawn at random from the bag. The probability that all of them are red is:
A)1/22
B) 3/22
C) 2/91
D) 2/77
\
...
Thursday, 25 April 2019
Aptitude Hack#61(25-4-19)

Question:
The area of a square is 196 sq cm whose side is half of the radius of a circle. The circumference of the circle is equal to the breadth of a rectangle if the perimeter of a rectangle is 712 cm. What is the length of the rectangle?
A) 196 cm
B) 186...
Wednesday, 24 April 2019
Aptitude Hack#60(24-4-19)

Question:
What is the sum of two consecutive odd numbers, the difference of whose squares is 56?
A) 30
B) 28
C) 34
D) 32
...
Tuesday, 23 April 2019
Monday, 22 April 2019
Aptitude Hack#58(22-4-19)

Question:
There are two examinations rooms A and B. If 10 students are sent from A to B, then the number of students in each room is the same. If 20 candidates are sent from B to A, then the number of students in A is double the number of students in B. The number of students...
Sunday, 21 April 2019
Aptitude Hack#57(21-4-19)

Question:
In a shower, 5 cm of rain falls. The volume of water that falls on 1.5 hectares of the ground is:
A) 75 ㎥
B) 750 ㎥
C) 7500 ㎥
D) 75000 ...
Saturday, 20 April 2019
Aptitude Hack#56(20-4-19)

Question:
A certain amount earns simple interest of Rs. 1750 after 7 years. Had the interest been 2% more, how much more interest would it have earned?
A) Rs. 35
B) Rs. 245
C) Rs. 350
D) Cannot be determined
...
Friday, 19 April 2019
Aptitude Hack#55(19-4-19)

Question:
In class, there are 15 boys and 10 girls. Three students are selected at random. The probability that 1 girl and 2 boys are selected, is:
A) 21/46
B) 25/117
C)1/50
D) 3/2...
Thursday, 18 April 2019
Aptitude Hack#54(18-4-19)

Question:
Amit has a certain average for 9 innings. In the tenth innings, he scores 100 runs thereby increasing his average by 8 runs. His new average is:
A) 20
B) 21
C) 28
D) 32 ...
Wednesday, 17 April 2019
Aptitude Hack#53(17-4-19)

Question:
What will be the next element in the given series
9, 25, 49, 121, ...
A)169
B)225
C)196
D)22...
Monday, 15 April 2019
Aptitude Hack#51(15-4-19)

Question:
P, Q, and R can do a piece of work in 40, 60 and 120 days respectively. In how many days can P do the work if he is assisted by Q and R on every fourth day?
A) 83/3 days
B) 3/5 days
C) 80/3 days
D) 4/3 days
...
Sunday, 14 April 2019
Aptitude Hack#50(14-4-19)

Question:
Which number does not belong in the series below?
2, 5, 10, 17, 26, 37, 50, 64
A) 17
B) 37
C) 64
D) 26
...
Saturday, 13 April 2019
Aptitude Hack#49(13-4-19)

Question:
8 litres are drawn from a cask full of wine and is then filled with water. This operation is performed three more times. The ratio of the quantity of wine now left in cask to that of water is 16 : 65. How much wine did the cask hold originally?
A. 18 litres
B. 24...
Friday, 12 April 2019
Integer Promotions in C
Integer Promotions in C
Some data types like char, short int take less number of bytes than int, these data types are automatically promoted to int or unsigned int when an operation is performed on them. This is called integer promotion. For example, no arithmetic calculation happens on smaller types like char, short and enum. They are first converted...
Aptitude Hack#48(12-4-19)

Question:
The angle of elevation of a ladder leaning against a wall is 60° and the foot of the ladder is 4.6 m away from the wall. The length of the ladder is:
A) 2.3 m
B) 4.6 m
C) 7.8 m
D) 9.2 m
...
Thursday, 11 April 2019
Tricky Interview #1

Question:
W A C Program That Prints All The vowels Given In String Without Using IF and Break Statements In program?
Submit Ur Answers (Follow The Link)
Link: https://docs.google.com/forms/d/e/1FAIpQLSeBXalNTB5cLX8dC8BlFmzGcItV52GBiUkqaaCM2q_bpaDnKg/view...
Aptitude Hack#47(11-3-19)

Question:
From a group of 7 men and 6 women, five persons are to be selected to form a committee so that at least 3 men are there on the committee. In how many ways can it be done?
A) 564
B) 645
C) 735
D) 756
...
Wednesday, 10 April 2019
Aptitude Hack#46(10-4-19)

Question:
Find out the wrong number in the given sequence of numbers.
36, 54, 18, 27, 9, 18.5, 4.5
A) 4.5
B) 18.5
C) 54
D) 18
...
Tuesday, 9 April 2019
Generic Storing of Number
Question:
Write a Java program the implements a generic sort method using any of the sorting techniques.
Solution:
public class Students{
public static <T extends Comparable<T>> void sortingMethod(Number[] i2) {
int i,j,n;
n=i2.length;
for(i=0;i<n;i++)
...