- Home
- Interview Questions
- C Programming
A source code file contains code as written in whatever language the programmer is using. An object code file contains machine language code; it need not be the code for a complete program. An executable file contains the complete code, in machine language, constituting an executable program.
a. Defining program objectives.
b. Designing the program.
c. Coding the program.
d. Compiling the program.
e. Running the program.
f. Testing and debugging the program.
g. Maintaining and modifying the program.
They are called functions.
A semantic error is one of meaning. Here’s an example in English: "This sentence is excellent Czech." Here's a C example:
thrice_n = 3 + n;
There were 3020 words and 350 lines.
Here, 3020 and 350 represent the values of the two variables.
printf("There were %d words and %d lines.\n", words, lines);
One reason is that long may accommodate larger numbers than int on your system; another reason is that if you do need to handle larger values, you improve portability by using a type guaranteed to be at least 32 bits on all systems.
To get exactly 32 bits, you could use int32_t , provided it was defined for your system. To get the smallest type that could store at least 32 bits, use int_least32_t . And to get the type that would provide the fastest computations for 32 bits, choose int_fast32_t .
Whitespace consists of spaces, tabs, and newlines. C uses whitespace to separate tokens from one another; scanf() uses whitespace to separate consecutive input items from each other.
printf("The double type is %z bytes..\n", sizeof (double));
The z in %z is a modifier, not a specifier, so it requires a specifier for it to modify. You could use %zd to print the result in base 10 or use a different specifier to print using a different base, for example, %zx for hexadecimal.
#define ( {
#define ) }
The substitutions would take place. Unfortunately, the preprocessor cannot discriminate between those parentheses that should be replaced with braces and those that should not. Therefore,
#define ( { #define ) } int main(void) ( printf("Hello, O Great One!\n"); ) becomes int main{void} { printf{"Hello, O Great One!\n"}; }