What determines whether something is an invalid constant?
Query Karo Latest Questions
Poll Results
Participate in Poll, Choose Your Answer.
Paper of size A0 has dimensions 1189mm*841mm.Each subsequent size A(n) is defined as A(n-1) cut in half parallel to its shorter sides. Thus paper of size A1 would have dimensions 841mm*594mm.Write a program to calculate and print paper sizes A0, ...Read more
Paper of size A0 has dimensions 1189mm*841mm.Each subsequent size A(n) is defined as A(n-1) cut in half parallel to its shorter sides. Thus paper of size A1 would have dimensions 841mm*594mm.Write a program to calculate and print paper sizes A0, A1, A2,… A8.
Read lessPoll Results
No votes. Be the first one to vote.
Participate in Poll, Choose Your Answer.
Poll Results
Participate in Poll, Choose Your Answer.
Poll Results
No votes. Be the first one to vote.
Participate in Poll, Choose Your Answer.
int main() { int a, float b, int c; a=25; b=3.24; c=a+b*b-35; }
Poll Results
No votes. Be the first one to vote.
Participate in Poll, Choose Your Answer.
Poll Results
No votes. Be the first one to vote.
Participate in Poll, Choose Your Answer.
#include<stdio. h> int main() { int a=35; float b=3.24; printf(“%d %f %d”, a, b+1.5,235); }
#include<stdio. h>
int main()
{
int a=35; float b=3.24;
printf(“%d %f %d”, a, b+1.5,235);
}
Read less
While defining a constant there are some rules that must be followed. for example: To define integer constant rules are: -It must have at least one digit. -There must be no decimal point. -It does not allow any blanks or commas. -An integer constant can be both negative and positive. -We assume an iRead more
While defining a constant there are some rules that must be followed.
for example: To define integer constant rules are:
-It must have at least one digit.
-There must be no decimal point.
-It does not allow any blanks or commas.
-An integer constant can be both negative and positive.
-We assume an integer constant to be positive if there is no sign in front of that constant.
-The allowable range for this type of constant is from -32768 to 32767.
similarly, rules exist for the string constant, real constant, character constant, floating-point constant, etc.
Ex:
‘ab’ is an invalid character constant (since char must have only one literal)
25,234 is an invalid integer constant (since is not an integer)
25 is an invalid floating-point constant (since it doesn’t contain . a period), etc.
See less