CoolInterview.com - World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions
Our Services
Get 9,000 Interview Questions & Answers in an eBook.




Get it now !!
Send your Resume to 6000 Companies
C Interview Questions & Answers - Learning Mode
COOLINTERVIEW.COM PROGRAMMING LANGUAGES INTERVIEW QUESTIONS C INTERVIEW QUESTIONS QUESTIONS & ANSWERS - LEARNING MODE

C Interview Questions & Answers - Learning Mode

C is a high-level and general purpose programming language that is ideal for developing firmware or portable applications. Originally intended for writing system software, C was developed at Bell Labs by Dennis Ritchie for the Unix Operating System (OS) in the early 1970s. With the increasing popularity of object-oriented programming, C is being rapidly replaced as "the" programming language by C++, a superset of the C language that uses an entirely different set of programming concepts, and by Java, a language similar to but simpler than C++, that was designed for use in distributed networks.

Try C Interview Questions & Answers - Exam Mode
Subcategories for C Interview Questions & Answers - Learning Mode

Following are sub categories for which Interview Questions & Answers are available under C Interview Questions & Answers - Learning Mode. Please select the appropriate sub-category:-

Arrays in C Interview Questions & Answers (18) Learning Mode | Exam Mode

Branches & Loops in C Interview Questions & Answers (22) Learning Mode | Exam Mode

C Basics Interview Questions & Answers (92) Learning Mode | Exam Mode

Dynamic Memory Allocation in C Interview Questions & Answers (21) Learning Mode | Exam Mode

File Operations in C Interview Questions & Answers (16) Learning Mode | Exam Mode

Functions in C Interview Questions & Answers (59) Learning Mode | Exam Mode

Operators in C Interview Questions & Answers (22) Learning Mode | Exam Mode

Pointers in C Interview Questions & Answers (43) Learning Mode | Exam Mode

Strings in C Interview Questions & Answers (32) Learning Mode | Exam Mode

Structures in C Interview Questions & Answers (39) Learning Mode | Exam Mode

Variables in C Interview Questions & Answers (39) Learning Mode | Exam Mode

Previous 1 2 3 4 5 6 7 8 Next

Sort By : Latest First | Oldest First | By Rating

C Interview Questions & Answers - Learning Mode
Try C Interview Questions & Answers - Exam Mode
Question: What would be the output of the following program?
main()
{
const int x=5;
int *ptrx;
ptrx=&x;
*ptrx=10;
printf("%d",x);
}




Answer: It depends on compiler.

In C++, it is not allowed to convert const int* to int*. So error

In C, it is ok, and i = 10; So dont use C compiler, it is time to use C++ compiler, just my one cent
Source: CoolInterview.com
Question: What is hashing ?

Answer: To hash means to grind up, and that?s essentially what hashing is all about. The heart of a hashing algorithm is a hash function that takes your nice, neat data and grinds it into some random-looking integer.

The idea behind hashing is that some data either has no inherent ordering (such as images) or is expensive to compare (such as images). If the data has no inherent ordering, you can?t perform comparison searches.

If the data is expensive to compare, the number of comparisons u Source: CoolInterview.com
Question: What are bit fields? What is the use of bit fields in a structure declaration?

Answer: No answer available currently.
Question: Can there be a mouse click and drag function used together to rotate a circle in c?please give which are they?

Answer: try the ncurses library for the linux systems........ there are hooks for events and actions over there,,, mostly ncurses lib is installed in distro,,,,,,,

compile by..


cc -c myprog.c -o myprog.o
cc myprog.o -lncurses myprog_exe Source: CoolInterview.com
Question: What is page thrashing?

Answer: Some operating systems (such as UNIX or Windows in enhanced mode) use virtual memory. Virtual
memory is a technique for making a machine behave as if it had more memory than it really has, by using disk space to simulate RAM (random-access memory). In the 80386 and higher Intel CPU chips, and in most other modern microprocessors (such as the Motorola 68030, Sparc, and Power PC), exists a piece of hardware called the Memory Management Unit, or MMU.

The MMU treats memory as if it were co Source: CoolInterview.com
Question: When should a type cast be used ?

Answer: There are two situations in which to use a type cast. The first use is to change the type of an operand to an arithmetic operation so that the operation will be performed properly.

The second case is to cast pointer types to and from void * in order to interface with functions that expect or return void pointers.

For example, the following line type casts the return value of the call to malloc() to be a pointer to a foo structure.

struct foo *p = (struct foo *) malloc(sizeof Source: CoolInterview.com
Question: How can we open a image file through C program



Answer: In C, generally we?can open files having text format...

other types of files can be opened in binary format only using

file *fp;

fp=fopen("filename","rb+");// where b stands for binary format
Source: CoolInterview.com
Question: A lift can accept a maximum load of 1000 kg.write a program to check how many people enter lift & what is the total weight currently present in the lift? If it exceeds maximum limit,set a variable for overweight.if overweight variable is set ring alarm.

Answer: No answer available currently.
Question: What is the difference between unix and linux.

Answer: There is big difference Unix does not support GUI but Linux support it.
Unix is less secure over networking .
Linux is more secure than any other O.S.
Source: CoolInterview.com
Question: struct Foo
{
char *pName;
char *pAddress;
};
main()
{
struct Foo *obj = malloc(sizeof(struct Foo));
clrscr();
obj->pName = malloc(100);
obj->pAddress = malloc(100);
strcpy(obj->pName,"Your Name");
strcpy(obj->pAddress, "Your Address");
free(obj);
printf("%s", obj->pName);
printf("%s", obj->pAddress);
}




Answer: this gives runtime error...

Source: CoolInterview.com
Question: What is a default TCP/IP socket assigned for SQL Server?

Answer:
Question: What is difference between the test effort and the test procedure?

Answer: Both are different concepts. Test effort defines how much time required to execute a particular test case. Test procedure defines the required actions to execute that test case.
Source: CoolInterview.com
Question: What is the use of typedef?

Answer: Typedef is used to change the name of the variable used earlier.It is used specially in structures. Source: CoolInterview.com
Question: What is the output of the following program:
Int x = 3, y = 2;
foo(x, y)
{ x = x + 2;
y = y + 3;
printf (?%d %d?, x,y);
}
main0
{ int x,y;
x = 5;
y = 5;
printf (?%d %d?, x,y);
}
a) 7 8 5 5 b) 5 5 5 5 c) 5 5 3 2 d) 7 8 7 8


Answer: 5 5 5 5 Source: CoolInterview.com
Question: What is the code to find our age,for example if my date of birth is 4/12/1986 and today date is 16/11/2008
answer should give our year,month,no of days


Answer: #include<stdio.h>
#include<conio.h>
void main(void)
{
typedef struct date
{
unsigned int day;
unsigned int month;
unsigned int year;
};
struct date dob={0,0,0};
struct date present={0,0,0};
struct date age={0,0,0};
clrscr();

// struct dob={0,0,0};
printf(" Please enter your DOB");
scanf(" %d%d%d",&dob.day,&dob.month,&dob.year);
printf(" Your date of birth=%2d/%2d/%d",dob.day,dob. Source: CoolInterview.com
Question: How i can run *.bat or *.cmd file by using system function in c ?

Answer: system("c:/*.bat"); Source: CoolInterview.com
Question: using c-strings write a program that will analyse the text"1.1my brother is taller than me.1.2 I am a boy of sixteen years old". The program should remove multiple spaces betweem words,find the longest word in the text,search and identify the number of letters"e", extact the number of integers , extract the number of doubles, extract the number of words in each sentence and identify the number of sentences in the text.

Answer: No answer available currently.
Question: Which language is not high-level language?

Answer: machine level language Source: CoolInterview.com
Question: Why does a linker error occurs for the segment:
main()
{
extern int i;
i=20;
printf("%d",sizeof(i));
}


Answer: You cannot define the value of an extern variable, should be defined in some other header or cpp file, so it will give a linker error. Source: CoolInterview.com
Question: void func1(int (*a)[10])
{
printf("Ok it works");
}
void func2(int a[][10])
{
printf("Will this work?");
}

main()
{
int a[10][10];
func1(a);
func2(a);
}




Answer: Ok it works Will this work? Source: CoolInterview.com

Previous 1 2 3 4 5 6 7 8 Next



India News Network
Latest 20 Questions
Payment of time- barred debt is: (a) Valid (b) Void (c) Illegal (d) Voidable
Consideration is defined in the Indian Contract Act,1872 in: (a) Section 2(f) (b) Section 2(e) (c) Section 2(g) (d) Section 2(d)
Which of the following is not an exception to the rule, "No consideration, No contract": (a) Natural love and affection (b) Compensation for involuntary services (c) Completed gift (d) Agency
Consideration must move at the desire of: (a) The promisor (b) The promisee (c) The promisor or any other party (d) Both the promisor and the promisee
An offer which is open for acceptance over a period of time is: (a) Cross Offer (b) Counter Offer (c) Standing Offer (d) Implied Offer
Specific offer can be communicated to__________ (a) All the parties of contract (b) General public in universe (c) Specific person (d) None of the above
_________ amounts to rejection of the original offer. (a) Cross offer (b) Special offer (c) Standing offer (d) Counter offer
A advertises to sell his old car by advertising in a newspaper. This offer is caleed: (a) General Offer (b) Special Offer (c) Continuing Offer (d) None of the above
In case a counter offer is made, the original offer stands: (a) Rejected (b) Accepted automatically (c) Accepted subject to certain modifications and variations (d) None of the above
In case of unenforceable contract having some technical defect, parties (a) Can sue upon it (b) Cannot sue upon it (c) Should consider it to be illegal (d) None of the above
If entire specified goods is perished before entering into contract of sale, the contract is (a) Valid (b) Void (c) Voidable (d) Cancelled
______________ contracts are also caled contracts with executed consideration. (a) Unilateral (b) Completed (c) Bilateral (d) Executory
A offers B to supply books @ Rs 100 each but B accepts the same with condition of 10% discount. This is a case of (a) Counter Offer (b) Cross Offer (c) Specific Offer (d) General Offer
_____________ is a game of chance. (a) Conditional Contract (b) Contingent Contract (c) Wagering Contract (d) Quasi Contract
There is no binding contract in case of _______ as one's offer cannot be constructed as acceptance (a) Cross Offer (b) Standing Offer (c) Counter Offer (d) Special Offer
An offer is made with an intention to have negotiation from other party. This type of offer is: (a) Invitation to offer (b) Valid offer (c) Voidable (d) None of the above
When an offer is made to the world at large, it is ____________ offer. (a) Counter (b) Special (c) General (d) None of the above
Implied contract even if not in writing or express words is perfectly _______________ if all the conditions are satisfied:- (a) Void (b) Voidable (c) Valid (d) Illegal
A specific offer can be accepted by ___________. (a) Any person (b) Any friend to offeror (c) The person to whom it is made (d) Any friend of offeree
An agreement toput a fire on a person's car is a ______: (a) Legal (b) Voidable (c) Valid (d) Illegal
Cache = 0.640625 Seconds