Types of Variables in C Language & Rules for Constructing Variable Names

As we saw earlier, an entity that may vary during program execution is called a variable. Variable names are names given to locations in memory. These locations can contain integer, real or character constants. In any language, the types of variables that it can support depend on the types of… Continue reading

Rules for Constructing Character Constants

A character constant is a single alphabet, a single digit or a single special symbol enclosed within single inverted commas. Both the inverted commas should point to the left. For example, ’A’ is a valid character constant whereas ‘A’ is not. The maximum length of a character constant can be… Continue reading

Rules for Constructing Real Constants

Real constants are often called Floating Point constants. The real constants could be written in two forms—Fractional form and Exponential form. Following rules must be observed while constructing real constants expressed in fractional form: A real constant must have at least one digit. It must have a decimal point. It… Continue reading

C Programming Interview Questions and Answers-7

Q: – Write a program to reverse a string with out using any array? #include<stdio.h> int main() { char *str=”Mahesh”; char *ptr=str+strlen(str); while(ptr>=str) { printf(“%c”,*ptr); ptr–; } } Q: – How do you find IP adress of ur system? ipconfig – in windows cmd mode. ifconfig -a in linux and… Continue reading

C Programming Interview Questions and Answers-6

Q: – Explain “method”? A Method is a programmed procedure. It is defined as part of a class also included in any object of that class. Class can have more than one methods. It can be re-used in multiple objects. Q: – What is the output of the bellow program?… Continue reading

C Programming Interview Questions and Answers-5

Q: – How do you remove a macro name? By using the #undef directive with a macro name, that macro name can be removed, or “undefined.” Q: – Why do you need the #endif directive? The #endif directive is used with an #if, #ifdef, or #ifndef directives because statements under… Continue reading

C Programming Interview Questions and Answers-4

Q: – Why do we need function prototypes? With the help of a function prototype, the compiler can automatically perform type checking on the definition of the function, which saves you time in debugging the program. Q: – Can a function return a pointer? Yes Q: – Why do you… Continue reading