C Programming - Declarations and Initializations
Why should I learn to solve C Programming questions and answers section on "Declarations and Initializations"?
Learn and practise solving C Programming questions and answers section on "Declarations and Initializations" to enhance your skills so that you can clear interviews, competitive examinations, and various entrance tests (CAT, GATE, GRE, MAT, bank exams, railway exams, etc.) with full confidence.
Where can I get the C Programming questions and answers section on "Declarations and Initializations"?
IndiaBIX provides you with numerous C Programming questions and answers based on "Declarations and Initializations" along with fully solved examples and detailed explanations that will be easy to understand.
Where can I get the C Programming section on "Declarations and Initializations" MCQ-type interview questions and answers (objective type, multiple choice)?
Here you can find multiple-choice C Programming questions and answers based on "Declarations and Initializations" for your placement interviews and competitive exams. Objective-type and true-or-false-type questions are given too.
How do I download the C Programming questions and answers section on "Declarations and Initializations" in PDF format?
You can download the C Programming quiz questions and answers section on "Declarations and Initializations" as PDF files or eBooks.
How do I solve C Programming quiz problems based on "Declarations and Initializations"?
You can easily solve C Programming quiz problems based on "Declarations and Initializations" by practising the given exercises, including shortcuts and tricks.
- Declarations and Initializations - General Questions
- Declarations and Initializations - Find Output of Program
- Declarations and Initializations - Point Out Errors
- Declarations and Initializations - Point Out Correct Statements
- Declarations and Initializations - True / False Questions
- Declarations and Initializations - Yes / No Questions
fmod(x,y) - Calculates x modulo y, the remainder of x/y.
This function is the same as the modulus operator. But fmod() performs floating point divisions.
Example:
#include <stdio.h>
#include <math.h>
int main ()
{
printf ("fmod of 3.14/2.1 is %lf\n", fmod (3.14,2.1) );
return 0;
}
Output:
fmod of 3.14/2.1 is 1.040000
Internal Linkage-> means static variables and functions with file scope.
None Linkage-> means Local variables.
Variable names in C are made up of letters (upper and lower case) and digits. The underscore character ("_") is also permitted. Names must not begin with a digit.
Examples of valid (but not very descriptive) C variable names:
=> foo
=> Bar
=> BAZ
=> foo_bar
=> _foo42
=> _
=> QuUx
1 : | extern int fun(); |
2 : | int fun(); |
extern int fun(); declaration in C is to indicate the existence of a global function and it is defined externally to the current module or in another file.
int fun(); declaration in C is to indicate the existence of a function inside the current module or in the same file.
/* Example for ceil() and floor() functions: */
#include<stdio.h>
#include<math.h>
int main()
{
printf("\n Result : %f" , ceil(1.44) );
printf("\n Result : %f" , ceil(1.66) );
printf("\n Result : %f" , floor(1.44) );
printf("\n Result : %f" , floor(1.66) );
return 0;
}
// Output:
// Result : 2.000000
// Result : 2.000000
// Result : 1.000000
// Result : 1.000000