You are on page 1of 5

C QUESTIONS

1. 2. 3. 4. 5. 6. ". $. &. 1'. 11. 12. 13. 14. 15. 16. 1". 1$. 1&. 2'. 21. 22. 23. 24. 25. 26. 2". 2$. 2&. 3'. 31. 32. 33. 34. 35. 36. 3". 3$. 3&. 4'. 41. 42. 43. 44. 45. 46. 4". What does static variable mean? What is a pointer? What is a structure? What are the differences between structures and arrays? In header files whether functions are declared or defined? What are the differences between malloc ! and calloc !? What are macros? what are its advanta#es and disadvanta#es? %ifference between pass by reference and pass by value? What is static identifier? Where are the auto variables stored? Where does #lobal( static( local( re#ister variables( free memory and ) *ro#ram instructions #et stored? %ifference between arrays and lin+ed list? What are enumerations? %escribe about stora#e allocation and scope of #lobal( e,tern( static( local and re#ister variables? What are re#ister variables? What are the advanta#e of usin# re#ister variables? What is the use of typedef? )an we specify variable field width in a scanf ! format strin#? If possible how? -ut of f#ets ! and #ets ! which function is safe to use and why? %ifference between strdup and strcpy? What is recursion? %ifferentiate between a for loop and a while loop? What are it uses? What are the different stora#e classes in )? Write down the e.uivalent pointer e,pression for referrin# the same element a/i0/10/+0/l0? What is difference between 2tructure and 3nions? What the advanta#es of usin# 3nions? What are the advanta#es of usin# pointers in a pro#ram? What is the difference between 2trin#s and 4rrays? In a header file whether functions are declared or defined? What is a far pointer? where we use it? 5ow will you declare an array of three function pointers where each function receives two ints and returns a float? what is a 6377 *ointer? Whether it is same as an uninitiali8ed pointer? What is a 6377 9acro? What is the difference between a 6377 *ointer and a 6377 9acro? What does the error :6ull *ointer 4ssi#nment: mean and what causes this error? What is near( far and hu#e pointers? 5ow many bytes are occupied by them? 5ow would you obtain se#ment and offset addresses from a far address of a memory location? 4re the e,pressions arr and ;arr same for an array of inte#ers? %oes mentionin# the array name #ives the base address in all the conte,ts? <,plain one method to process an entire strin# as one unit? What is the similarity between a 2tructure( 3nion and enumeration? )an a 2tructure contain a *ointer to itself? 5ow can we chec+ whether the contents of two structure variables are same or not? 5ow are 2tructure passin# and returnin# implemented by the complier? 5ow can we read=write 2tructures from=to data files? What is the difference between an enumeration and a set of pre>processor ? defines? what do the :c: and :v: in ar#c and ar#v stand for? 4re the variables ar#c and ar#v are local to main? What is the ma,imum combined len#th of command line ar#uments includin# the space between ad1acent ar#uments?

Go Up

4$. If we want that any wildcard characters in the command line ar#uments should be appropriately e,panded( are we re.uired to ma+e any special provision? If yes( which? 4&. %oes there e,ist any way to ma+e the command line ar#uments available to other functions without passin# them as ar#uments to the function? 5'. What are bit fields? What is the use of bit fields in a 2tructure declaration? 51. @o which numberin# system can the binary number 11'11''1''1111'' be easily converted to? 52. Which bit wise operator is suitable for chec+in# whether a particular bit is on or off? 53. Which bit wise operator is suitable for turnin# off a particular bit in a number? 54. Which bit wise operator is suitable for puttin# on a particular bit in a number? 55. Which bit wise operator is suitable for chec+in# whether a particular bit is on or off? 56. which one is e.uivalent to multiplyin# by 2A7eft shiftin# a number by 1 or 7eft shiftin# an unsi#ned int or char by 1? 5". Write a pro#ram to compare two strin#s without usin# the strcmp ! function. 5$. Write a pro#ram to concatenate two strin#s. 5&. Write a pro#ram to interchan#e 2 variables without usin# the third one. 6'. Write pro#rams for 2trin# Beversal ; *alindrome chec+ 61. Write a pro#ram to find the Cactorial of a number 62. Write a pro#ram to #enerate the Cibinocci 2eries 63. Write a pro#ram which employs Becursion 64. Write a pro#ram which uses )ommand 7ine 4r#uments 65. Write a pro#ram which uses functions li+e strcmp !( strcpy !? etc 66. What are the advanta#es of usin# typedef in a pro#ram? 6". 5ow would you dynamically allocate a one>dimensional and two>dimensional array of inte#ers? 6$. 5ow can you increase the si8e of a dynamically allocated array? 6&. 5ow can you increase the si8e of a statically allocated array? "'. When reallocatin# memory if any other pointers point into the same piece of memory do you have to read1ust these other pointers or do they #et read1usted automatically? "1. Which function should be used to free the memory allocated by calloc !? "2. 5ow much ma,imum can you allocate in a sin#le call to malloc !? "3. )an you dynamically allocate arrays in e,panded memory? "4. What is ob1ect file? 5ow can you access ob1ect file? "5. Which header file should you include if you are to develop a function which can accept variable number of ar#uments? "6. )an you write a function similar to printf !? "". 5ow can a called function determine the number of ar#uments that have been passed to it? "$. )an there be at least some solution to determine the number of ar#uments passed to a variable ar#ument list function? "&. 5ow do you declare the followin#A o 4n array of three pointers to chars o 4n array of three char pointers o 4 pointer to array of three chars o 4 pointer to function which receives an int pointer and returns a float pointer o 4 pointer to a function which receives nothin# and returns nothin# $'. What do the functions atoi !( itoa ! and #cvt ! do? $1. %oes there e,ist any other function which can be used to convert an inte#er or a float to a strin#? $2. 5ow would you use .sort ! function to sort an array of structures? $3. 5ow would you use .sort ! function to sort the name stored in an array of pointers to strin#? $4. 5ow would you use bsearch ! function to search a name stored in array of pointers to strin#? $5. 5ow would you use the functions sin !( pow !( s.rt !?

$6. $". $$. $&. &'. &1. &2. &3. &4.

5ow would you use the functions memcpy !( memset !( memmove !? 5ow would you use the functions fsee+ !( freed !( fwrite ! and ftell !? 5ow would you obtain the current time and difference between two times? 5ow would you use the functions randomi8e ! and random !? 5ow would you implement a substr ! function that e,tracts a sub strin# from a #iven strin#? What is the difference between the functions rand !( random !( srand ! and randomi8e !? What is the difference between the functions memmove ! and memcpy !? 5ow do you print a strin# on the printer? )an you use the function fprintf ! to display the output on the screen?

C++ QUESTIONS

Go Up

1. 2. 3. 4. 5. 6. ". $. &. 1'. 11. 12. 13. 14. 15. 16. 1". 1$. 1&. 2'. 21. 22. 23. 24. 25. 26. 2". 2$. 2&. 3'. 31. 32. 33. 34. 35. 36. 3".

What is a class? What is an ob1ect? What is the difference between an ob1ect and a class? What is the difference between class and structure? What is public( protected( private? What are virtual functions? What is friend function? What is a scope resolution operator? What do you mean by inheritance? What is abstraction? What is polymorphism? <,plain with an e,ample. What is encapsulation? What do you mean by bindin# of data and functions? What is function overloadin# and operator overloadin#? What is virtual class and friend class? What do you mean by inline function? What do you mean by public( private( protected and friendly? When is an ob1ect created and what is its lifetime? What do you mean by multiple inheritance and multilevel inheritance? %ifferentiate between them. %ifference between realloc ! and free? What is a template? What are the main differences between procedure oriented lan#ua#es and ob1ect oriented lan#ua#es? What is B @ @ I ? What are #eneric functions and #eneric classes? What is namespace? What is the difference between pass by reference and pass by value? Why do we use virtual functions? What do you mean by pure virtual functions? What are virtual classes? %oes cDD support multilevel and multiple inheritance? What are the advanta#es of inheritance? When is a memory allocated to a class? What is the difference between declaration and definition? What is virtual constructors=destructors? In cDD there is only virtual destructors( no constructors. Why? What is late bound function call and early bound function call? %ifferentiate. 5ow is e,ception handlin# carried out in cDD?

3$. When will a constructor e,ecuted? 3&. What is %ynamic *olymorphism? 4'. Write a macro for swappin# inte#ers.

1. 2. 3. #. *. !. ,. .. 1. 12. 11. 12. 13. 1#. 1*. 1!. 1,. 1.. 11. 22. 21. 22. 23. 2#. 2*. 2!.

Go Up DATA STRUCTURE QUESTIONS What is a data structure? What does abstract data type means? Evaluate the following prefix expression " 2! " 132#" $%imilar types can be as&ed' (onvert the following infix expression to post fix notation $$a 2')$b #'' "1 $%imilar types can be as&ed' +ow is it possible to insert different type of elements in stac&? %tac& can be described as a pointer. Explain. Write a -inary %earch program Write programs for -ubble %ort/ 0uic& sort Explain about the types of lin&ed lists +ow would you sort a lin&ed list? Write the programs for 3in&ed 3ist $4nsertion and 5eletion' operations What data structure would you mostly li&ely see in a non recursive implementation of a recursive algorithm? What do you mean by -ase case/ 6ecursive case/ -inding 7ime/ 6un"7ime %tac& and 7ail 6ecursion? Explain 8uic& sort and merge sort algorithms and derive the time"constraint relation for these. Explain binary searching/ 9ibinocci search. What is the maximum total number of nodes in a tree that has : levels? :ote that the root is level $;ero' +ow many different binary trees and binary search trees can be made from three nodes that contain the &ey values 1/ 2 < 3? = list is ordered from smaller to largest when a sort is called. Which sort would ta&e the longest time to execute? = list is ordered from smaller to largest when a sort is called. Which sort would ta&e the shortest time to execute? When will you sort an array of pointers to list elements/ rather than sorting the elements themselves? 7he element being searched for is not found in an array of 122 elements. What is the average number of comparisons needed in a se8uential search to determine that the element is not there/ if the elements are completely unordered? What is the average number of comparisons needed in a se8uential search to determine the position of an element in an array of 122 elements/ if the elements are ordered from largest to smallest? Which sort show the best average behavior? What is the average number of comparisons in a se8uential search? Which data structure is needed to convert infix notations to post fix notations? What do you mean by> o %yntax Error o 3ogical Error o 6untime Error +ow can you correct these errors?

2,. 4n which data structure/ elements can be added or removed at either end/ but not in the middle? 2.. +ow will inorder/ preorder and postorder traversals print the elements of a tree? 21. ?arenthesis are never needed in prefix or postfix expressions. Why?

32. Which one is faster? = binary search of an orderd set of elements in an array or a se8uential search of the elements.

You might also like