Follow Our FB Page << >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

C Interview Questions
Questions Answers Views Company eMail

Create a registration form application by taking the details like username, address, phone number, email with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 3 users and display the details. While taking input password must appear as “****”.


Question 1: You want to conduct a survey within your classroom, on the quality of canteen’s food. You ask each of your class fellows to rank the quality of food between 1 and 5 (1 representing excellent quality and 5 representing worst quality). During the survey, you make a list containing the roll# of student and the opinion given by that student. The list can be as follow Roll # Opinion 234 1 235 1 236 5 237 1 238 2 239 3 240 5 241 5 242 1 To get the results of the survey, you need to determine the frequency of each opinion value. The frequency of an opinion is determined by counting the number of students giving that opinion. For example, for the above list the frequency of opinion value 1 is 4 and frequency of opinion value 4 is 0. After getting the frequency of each opinion, you can easily judge about the quality of the food by seeing through the frequency of each opinion. You need to develop a program to calculate the results of this survey. The program inputs the opinion of 50 students and counts the frequency of each opinion. It then displays a report showing the frequency of each opinion. Sample output: Opinion Frequency Remarks 1 5 Excellent 2 10 Good 3 15 Normal 4 10 Bad 5 10 Really bad

1 2732

write a c program to calculate sum of digits till it reduces to a single digit using recursion



how to build a exercise findig min number of e heap with list imlemented?


. A database table called PERSON contains the fields NAME, BASIC and HRA. Write a computer program to print a report which employee name and total salary for those employees whose total salary is more than 10,000. Total Salary = BASIC + HRA. At the end, the program should also print the total number of employees whose total salary is more than 10,000.

1 4821

Write a c program to print the even numbers followed by odd numbers in an array without using additional array

Tech Mahindra,

1 2247

Just came across this question, felt worth sharing, so here it is I want you to make a C/C++ program that for any positive integer n will print all the positive integers from 1 up to it and then back again! Let's say n=5 I want the program to print: 1 2 3 4 5 4 3 2 1. Too easy you say? Okay then... You can ONLY USE: 1 for loop 1 printf/cout statement 2 integers( i and n) and as many operations you want. NO if statements, NO ternary operators, NO tables, NO pointers, NO functions!

1 2235

write a program in c to read array check element is present or not?

1 2845

How to write a program to receive an integer & find its octal equivalent by using for loop?


1 2969

main() { int x, arr[8]={11,22,33,44,55,66,77,88}; x=(arr+2)[3]; printf(“%d”,x); }


8 13176

struct tag{ auto int x; static int y; };main() { struct tag s; s.x=4; s.y=5; printf(“%d”,s.x); }


2 9612

main() { struct test { char c; int i; char m; } t1; printf("%d %d\n", sizeof(t1), sizeof(t1.c)); }

Vector, Vector India,

1 7034

main() { unsigned int k = 987 , i = 0; char trans[10]; do { trans[i++] =(char) (k%16 > 9 ? k%16 - 10 + 'a' : '\0' ); } while(k /= 16); printf("%s\n", trans); }


4 9276

main() { FILE *fs; char c[10]; fs = fopen(“source.txt”, ”r”); /* source.txt exists and contains “Vector Institute” */ fseek(fs,0,SEEK_END); fseek(fs,-3L,SEEK_CUR); fgets(c,5,fs); puts(c); }


1 6875

main() { char as[] = "\\0\0"; int i = 0; do{ switch( as[i++]) {case '\\' : printf("A"); break; case 0 : printf("B"); break; default : printf("C"); break; }} while(i<3); }

Vector, Vector India,

4 6993

Post New C Questions

Un-Answered Questions { C }

What is nested structure in c?


Describe wild pointers in c?


#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }


What is the ANSI C Standard?


Why is event driven programming or procedural programming, better within specific scenario?


Explain the difference between call by value and call by reference in c language?


What is extern storage class in c?


What is data types?


Why do we use int main instead of void main in c?


difference between object file and executable file


c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above


How to establish connection with oracle database software from c language?


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.


Explain how do you determine whether to use a stream function or a low-level function?


Why main is used in c?