C Interview Questions
Questions Answers Views Company eMail

What is the output of following program ? int main() { int x = 5; printf("%d %d %d\n", x, x << 2, x >> 2); }

Amazon, Qualcomm,

5 14109

what is the definition of storage classes?

Wipro,

3 5261

write a program to compare 2 numbers without using logical operators?

IBM,

5 13310




what is self refrential structure

HCL,

3 4140

what is available in C language but not in C++?

CTS, TCS,

10 8794

What is volatile in c language?

HCL, TCS,

2 3269

wt is d full form of c

TCS, Wipro,

6 5735

what is the maximum limit of row and column of a matrix in c programming. in linux .

NIIT,

4 4684




write a c program to print the values in words eg:- 143 written it has (one hundred and forty three)& 104, 114 are also written words

Wipro, IBM, DELL, Google, Captronic, RCC, Mithi,

5 10303

who is first prime minister in india??

Wipro,

8 4251

how to find the largest element of array without using relational operater?

Satyam, Wipro,

6 8635

WHAT WILL BE OUTPUT OF BELOW CODE . . AND PLEASE EXPLAIN HOW IT COME .. #include #include void main() { int k=20; printf("%d%d%d%d",k,k++,++k,k); getch(); }

25 9909

What are the different flags in C? And how they are useful? And give example for each in different consequences?

1 2024

What is Lazy evaluation in C? Give an example.

1 2626

What is indirect recursion? give an example?

4 24493


Post New C Questions






Un-Answered Questions { C }

what is uses of .net

469


‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH .

1403


why to assign a pointer to null sometimes??how can a pointer we declare get assigned with a garbage value by default???

635


How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?

12539


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

720






develop algorithms to add polynomials (i) in one variable

872


Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.

808


Write a c program to build a heap method using Pointer to function and pointer to structure ?

3370


write a c program to print the next of a particular no without using the arithmetic operator or looping statements?

2011


Topics: Structures, Arrays, Searching and Sorting Assume there is a small mobile computer device including a hard disk and a slot for a memory card. The device shall be used to backup photos e.g. during holiday. Every time a memory card is connected all photos of the card are copied into a new folder automatically. And your task is to develop some basic controlling software to show, add, remove, search and sort the directories of photos. Step by Step Implementation 1.Define two symbolic constants, one to hold the total volume of the disk (e.g. VOLUME) and another one to hold the number of entries the files system of the device can handle (MAXFOLD). 2.Define a new structure data type named DATE to store a date consisting of year, month and day as unsigned values. 3.Define an other structure data type FOLDER to store the information of one folder of photos: ◦A title as character array of appropriate length ◦The location (event) the photos are taken as character array of appropriate length ◦The date of the day the photos are copied to the disk using the just defined data type DATE ◦The number of photos as natural number ◦And the size of the folder in MB as floating point value 4.Define the following global variables and initialise them: ◦disk as an array with MAXFOLD elements of data type FOLDER ◦folders as natural value to count the number of folders currently stored at the disk (valid elements in the array) TEST: Now you should be able to compile the code the first time without any warning or error. In the menu only "p" to print and "q" to quit will work!. 5.Now complete the functions given by their prototype: float freeSpace ();The function has to calculate the sum of the size component of all elements currently stored in the disk array. The function shall return the free space of the disk by the difference between the available total volume and the calculated sum. TEST: To test this function you only need to uncomment printing the "statusline" at the function actionmenu(). Compare the calculated value with a manual calculation of the example values given above. unsigned isBefore (DATE, DATE);The function checks if one date is before the other. There are 3 different possibilities which have to be handled. Imagine for example these 3 different combinations of values: ◦2010-01-01 : 2010-01-02 ◦2010-01-01 : 2010-02-01 ◦2010-01-01 : 2009-01-01 The function shall just return the result of the comparison. unsigned isEqual (DATE, DATE);The function checks if one date is equal to the other, all components have to be compared. The function shall just return the result of the comparison. int findByDate (DATE);As the array is should be kept in order (sorted by date) implement a binary search for a folder by its date here. You need only to adapt the binary search we used in the exercise. Use the 2 comparing functions above where appropriate. The function shall return the index of the element which was found or -1. TEST: Now you can try searching a folder by date via the "s" in the menu. Activate the corresponding part in the main function. int isSpaceLeft (FOLDER);This function compares the free space of the disk with the size of folder given with the parameter list. The function shall return 1 if there is enough space to add the folder, otherwise 0 (just the result of the comparison). void SortByDate ();This function shall implement the InsertionSort using the component date as key. Use the provided algorithm/souce code of the exercise as template. If you need a comparison between dates, use the function isBefore you have written again. void addFolder (FOLDER);The function has to check if the disk has additional capacities to add the new folder (number of folders and space left). If at least one of these conditions is false print an error message and return -1. Else there has to be added an other test to avoid 2 folder elements with the same date (use the findByDate function here. If there is no folder with the new date simply attach the new folder at the end of the array and call the sorting algorithm afterwards to keep the order in the array. TEST: Now you can try to add a folder via the "a" in the menu. Activate the corresponding part in the main function. void delDir (int);This function removes one element of the disk array. The input parameter contains the index of the element to delete. Deletion can simply be done by moving all elements at the right one to the left (overwriting the element to delete. The function may get a -1. This has to be checked first (certainly there is nothing to delete then!) Don't forget to decrement the counter of elements at the end. TEST: Now you can try to remove a folder by date via the "r" in the menu. Activate the corresponding part in the main function. unsigned findAllOfLocation(char[], FOLDER[]);This is an optional additional task: The function shall find all elements with the given value for the component location (first input parameter). The array elements which are found have to be added to the FOLDER array (second input parameter). As this parameter is an array we can use the result later in the main function. There kernel of function implements a modified linear search on the disk array (it does not stop if one element is found bat continues search until the location of all elements is checked). The finally function shall return the number of elements found in the disk array. TEST: Now you can try to add a folder by date via the "l" in the menu. Activate the corresponding part in the main function.

1114


how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....

598


how to construct a simulator keeping the logical boolean gates in c

760


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

649


Explain the process of converting a Tree into a Binary Tree.

1049


simple program of graphics and their output display

668