C Interview Questions
Questions Answers Views Company eMail

write a program to swap Two numbers without using temp variable.

Wipro, TCS, HCL, Satyam, Focus, Microsoft, HP, Infosys, Mannar Company, EMC, GreyB, Hitech, Huawei, Miles Software, Odessa Technologies,

75 144456

Can you think of a way when a program crashed before reaching main? If yes how?

2 4368

Write the program for displaying the ten most frequent words in a file such that your program should be efficient in all complexity measures.


3 20657

Consider a language that does not have arrays but does have stacks as a data type.and PUSH POP..are all defined .Show how a one dimensional array can be implemented by using two stacks.


3 6580

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.



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 5433

what is volatile in c language?

Honeywell, Cap Gemini, TCS, HCL, Tech Mahindra,

9 24126

what is the diference between pointer to the function and function to the pointer?


2 3337

what is the use of call back function in c?tell me with example


2 14559

difference between semaphores and mutex?

1 8346

write a fuction for accepting and replacing lowercase letter to'Z' with out using inline function.


5 8349

related to rdbms query .

2 4915

what is difference between array and structure?

IBM, Motorola, CTS, HCL, Google, TCS, College School Exams Tests,

44 108453

Given an array of length N containing integers between 1 and N, determine if it contains any duplicates.


3 8050

Given an array of numbers, except for one number all the others occur twice. Give an algorithm to find that number which occurs only once in the array.

6 8323

Post New C Questions

Un-Answered Questions { C }

pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)




largest Of three Number using without if condition?


You have given 2 array. You need to find whether they will create the same BST or not. For example: Array1:10 5 20 15 30 Array2:10 20 15 30 5 Result: True Array1:10 5 20 15 30 Array2:10 15 20 30 5 Result: False One Approach is Pretty Clear by creating BST O(nlogn) then checking two tree for identical O(N) overall O(nlogn) ..we need there exist O(N) Time & O(1) Space also without extra space .Algorithm ?? DevoCoder guest Posted 3 months ago # #define true 1 #define false 0 int check(int a1[],int a2[],int n1,int n2) { int i; //n1 size of array a1[] and n2 size of a2[] if(n1!=n2) return false; //n1 and n2 must be same for(i=0;ia1[i+1]) && (a2[i]>a2[i+1]) ) ) return false; } return true;//assumed that each array doesn't contain duplicate elements in themshelves }


write a program to concatenation the string using switch case?


develop algorithms to add polynomials (i) in one variable


how to introdu5ce my self in serco


what is ur strangth & weekness


Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10


2) Write a program that will help Air Traffic Control for an airport to view the sequence of flights ready for take-off. The airport can accommodate 10 flights waiting for take-off at any point in time. Each flight has a unique 3 digit numeric identifier.  Each time a flight takes-off, Air Traffic Control adds a flight to the waitlist. Each time a flight is added to the waitlist, the list of flights waiting to take-off must be displayed.  When a flight is cleared for take-off, Air Traffic Control removes the flight from the waitlist. Each time a flight takes-off, the list of flights waiting to take-off must be displayed.  Sequence of take-off is the sequence of addition to the waitlist


please help me..... please codes and flowchart plz turbo c lang po yan.....please asap response... 3. Make an astrology program. The user types in his or her birthday (month, day, and year as integer), and the program responds with the user’s zodiac sign, horoscope, and other information related to it. If the user’s birth year falls into a leap year, your program should display an appropriate message for it. NOTES: Conditional Statements: it should be with graphics




In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping


write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);


Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings