C Programming - Declarations and Initializations - Discussion
Discussion Forum : Declarations and Initializations - Point Out Correct Statements (Q.No. 2)
2.
Which of the following operations are INCORRECT?
Answer: Option
Explanation:
float a = 3.14; a = a%3; gives "Illegal use of floating point" error.
The modulus (%) operator can only be used on integer types. We have to use fmod() function in math.h for float values.
Discussion:
17 comments Page 1 of 2.
Xiyaz said:
5 years ago
int can only hold numbers not letters, here 'L'. So that's incorrect, Isn't it?
(4)
Vicky said:
1 decade ago
Here an option B and C variable are again defined that's is wrong I think so guy's please help me how to its correct?
Veni said:
6 years ago
I can't understand this, Can anyone explain clearly?
Raut Achyut said:
7 years ago
How to initialize 365L in K variable?
C.kumar said:
7 years ago
@Shan.
There is no need to assign L in integer type only we need to identify L in long D in duble and F in float.
eg-
int i=10;
long i =10L;
double i= 10D;
float i= 10F;
There is no need to assign L in integer type only we need to identify L in long D in duble and F in float.
eg-
int i=10;
long i =10L;
double i= 10D;
float i= 10F;
Shan said:
7 years ago
long int k = 365L; k = k;
in integer k how the character L is assigned.
is this is possible? PLease explain.
in integer k how the character L is assigned.
is this is possible? PLease explain.
Mitali said:
1 decade ago
% is a modulus operator. It gives the remainder after dividing. But in A we got reminder=0 so how it is not giving error.
Mitali said:
1 decade ago
Why in option B & C variables are redefined?
Durga said:
1 decade ago
Over flow means?
Poonam said:
1 decade ago
What about long int k=365L.
What is this L stands for?
What is this L stands for?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers