True or false: If you continuously increment a variable, it
will become negative?
1) True
2) False
3) It depends on the variable type
Answers were Sorted based on User's Feedback
Answer / k sriharsha
It will not become negative if we use unsign data type.
| Is This Answer Correct ? | 19 Yes | 3 No |
Answer / a programmer
It depends upon the variable type. Ex: if the variable is
declared as unsigned int then if we increment the value will
not become negative.
| Is This Answer Correct ? | 10 Yes | 2 No |
Answer / sachin
after a limit of the variable ,it becomes -ve.
for ex:-
#include<stdio.h>
void main()
int i;
if(i<=32767)
{
printf("%d",i);
i++;
}
}after printing 1 to 32767,it tries to become 32768 which is
outside the limit,so it goes to the other side and become
-32768 and loops become indefinite.
| Is This Answer Correct ? | 3 Yes | 0 No |
When should the const modifier be used?
What is data structure in c language?
What is maximum size of array in c?
Is main() function predfined or userdefined?
How do I declare a pointer to an array?
How do you construct an increment statement or decrement statement in C?
write a programme to enter some number and find which number is maximum and which number is minimum from enterd numbers.
program that accepts amount in figures and print that in words
2 Answers Infosys, Lovely Professional University, Wipro,
Find the O/p of the following 1) #include int main() { char c='1'; int j=atoi(c); }
What is clrscr ()?
How can you find the exact size of a data type in c?
How many keywords are there in c?