i want explaination about the program and its stack reprasetaion
fibbo(int n)
{
if(n==1 or n==0)
return n;
else
return fibbo(n-1)+fibbo(n-2);
}
main()
{
fibbo(6);
}
what is out put of the following code?
#include
class Base
{
Base()
{
cout<<"constructor base";
}
~Base()
{
cout<<"destructor base";
}
}
class Derived:public Base
{
Derived()
{
cout<<"constructor derived";
}
~Derived()
{
cout<<"destructor derived";
}
}
void main()
{
Base *var=new Derived();
delete var;
}
You are given a string which contains some special
characters. You also have set of special characters. You are
given other string (call it as pattern string). Your job is
to write a program to replace each special characters in
given string by pattern string. You are not allowed to
create new resulting string. You need to allocate some new
memory to given existing string but constraint is you can
only allocate memory one time. Allocate memory exactly what
you need not more not less.
what is the most appropriate way to write a multi-statement
macro?
8
what is the difference between exit() and _exit() functions?
24
what are advantages of U D F?
119
Device an algorithm for weiler-atherton polygon clipping,
where the clipping window can be any specified polygon
475
Read N characters in to an array . Use functions to do all
problems and pass the address of array to function.
1. Print only the alphabets . If in upper case print in
lower case vice versa.
2. Enter alphanumeric characters and form 2 array alphaets
and digits.Also print the count of each array.
3. Find the count of a certain character.
4. Print the positions where a certain character occured.
5. Print the characters between successive array elements.
6. Find the largest and smallest charcter. How many times
it each one occured.
7. Enter a certain range. Print out the array elements
which occured between these range.
8. Reverse a character array without using another array.
9. Reverse an array region.
10. Replace a the array elements with it next character .
Use a after z.
11. Code the array element with certain character as first
alphabet.
12. Duplicate all the vowels in a character array. What is
the new count.
13. Delete the vowels in a character array. What is the new
array count.
14. Print the count of all characters in the array.
15. Enter n alphabets and store a upto tht
charcter in array.What is the array count?
16. Sort a character array.
17. Merge 2 character arrays largearray,smallarray.
18. Find the pair with largest number of characters in between.
19. Find the numerical value of a charcter array.
20. Store n numeral characters in an arrray. Insert another
numeral character in a certain position.
21. Insert a character in a sorted array.
22. Merge 2 sorted arrays in sorted fashion.
23. Duplicate the least occuring character.
24. Write a menu driven program to circular right/left shift
an array of n elements.
25. Is the character array palindrome? if not make it
palindrome.
26. Concatenate the first n charaters to the end of the string.
27. Print all n group of chracters which are palindrome.
28. Concatneate the reverse of last n characters to the array.
585
Technical Ability Test:
This was difficult. three questions to be attempted in 60
min. The Coplete Technical Paper was as follows:
Write the Pseudo code for the following:
1. Wrie a function which returns the most frequent number
in a list of integers. Handle the case of more than one
number which meets this criterion.
public static int[] GetFrequency(int[] list)
2. Counting in Lojban, an artificial language developed
over the last fourty years, is easier than in most languages
The numbers from zero to nine are:
0 no
1 pa
2 re
3 ci
4 vo
5 mk
6 xa
7 ze
8 bi
9 so
Larger numbers are created by gluing the digit togather.
For Examle 123 is pareci
Write a program that reads in a lojban string(representing
a no less than or equal to 1,000,000) and output it in
numbers.
3. Where now stands that small knot of villages known as
the Endians, a mighty forest once stood. Indeed, legand has
it that you could have stoodon the edge of the wood and
seen it stretch out for miles, were it not for the trees
getting in the way.
In one section of the forest, the trees stood in a row and
were of hight from 1 to n, each hight occurring once and
once only.
A tree was only visible if there were no higher trees
before it in the row.
For example, if the heights were 324165, the only visible
trees would have been those of height 3,4 & 6.
Write a Program that takes an array of integers
representing the heights of the trees in the row as input
and prints the list of the visible trees.
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
//////////////////
Ques1: Given an array containing k nos in the range 1..n
and another scratch array of size n. Write an program to
remove the duplicates from the array.
Ques2: Given a table of the form:
Product Sold on
A 1/1/1980
B 1/1/1980
C 1/1/1980
A 1/1/1980
B 1/1/1980
C 2/1/1980
A 2/1/1980
There are 30 products and 10,000 records of such type. Also
the month period during which sales happened is given to u.
Write the program to display the result as:
Product Month No. of copies
A January 12
A February 15
A March 27
B January 54
B February 15
B March 10
C January 37
Ques3: Definition of priority queue was given. We have to
implement the priority queue using array of pointers with
the priorities given in the range 1..n.
The array could be accessed using the variable top. The
list corresponding to the array elements contains the items
having the priority as the array index.
Adding an item would require changing the value of top if
it has higher priority than top.
Extracting an item would require deleting the first element
from the corresponding queue.
The following class was given:
Ques4: An array of size 5X5 is given to us. The elements
from 1 to 25 are to be inserted in the array, such that
starting from a particular position for an element i, the
next element i+1can be inserted only at the mentioned
positions (u,v), and if these all positions are occupied
then it returns giving a count of how many positions have
been occupied in the array:
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
//////////////////
Example: if the starting element is 1 with the given
positions (1,2), then next element 2 can be placed at any
one of the positions marked with *.
_ _ _ _ _
1 _ _ _ *
_ _ _ _ _
_ _ * _ _
* _ _ _ _
2. Four questions of programming in c++, questions were:(
1:30 hr)
a) Bubble sort through recursion
b) Display Pattern:
1
2 3
4 5 6 7
8 9 10 11 12 13 14 15
…
c) Perform the functionality of 2-D array through 1-D array
and in it the functions to be performed were:
(1) Display the array in 2-D format
(2) Display a particular element
(3) Display a particular row
(4) Display a particular column
d) Give an efficient program for string matching like:
Text: this is the code in the text which you have
to search by code
Pattern: Code
Count the no. of occurrences of the pattern to be
searched
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////
//////////////////
a) suppose u r given a 4*3 rectangle like (take these
values from user)
Now u have to calculate the no. of squares in this
rectangle like:
No. of squares of dimension 1 is 12
No. of squares of dimension 2 is 6
No. of squares of dimension 3 is 2
No. of squares of dimension 4 is 0
Total no. of squares are 20.
b) Suppose u r given a string. U have to find the
occurance of the characters A-Z in that string. Each
character must appear in the string and must appear only
once. If It that occurs in string more than one time return
1 showing it is a perfect string otherwise return 0 showing
it is not a perfect string.
c) Suppose u r given 10000 marks. U have to pick up
top 20 top marks from them and display it on the screen.
(Use the optimal sorting algorithm)
d) Suppose u have a chess board. U have to insert 8
queens on the chessboard in the style that the queens don’t
intersect in the diagonals, columns and rows. If they
intersect return 1 else return 0.(that is no more than one
queen should be present either in row or column or
diagonals.)
If the queen is inserted at a position in the chessboard,
its count is 1.
send me the code of flow chart generator using C-programming
language amd this code should calculate the time and space
complexity of the given progran and able to generate
flowchart according to the given program?
How do you initialize function pointers? Give an example?
6
hi send me sample aptitude papers of cts?
120
hai iam working in sap sd module for one year and working
in lumax ind ltd in desp department but my problem is i
have done m.b.a in hr/marketing and working sap sd there is
any combination it. can you give right solution of my
problem. and what can i do?
write a program that reads lines(using getline), converts
each line to an integer using atoi, and computes the
average of all the numbers read. also compute the standard
deviation.
141
what is reason of your company position's in india no. 1.
hi folks i m approching for h1 b interview on monday 8th of
august at montreal and i m having little problem in my
approval notice abt my bithdate my employer has made a
mistake while applying it is 12th january and istead of
that he had done 18 the of january do any body have any
solution for that if yes how can i prove my visa officer
abt my real birthdate it urgent please let me know guys
thaks dipesh patel
94
I have written a pro*C program to fetch data from the
cursor. where in i have used the concept of BULK FETCH....
each FETCH statement is taking lots of time to fetch
specified number of rows at...