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 |
What is use of integral promotions in c?
What is the correct declaration of main?
What are the string functions? List some string functions available in c.
WHAT IS RTGS N MINIMUM AMT TO B TRANSFERD N WHAT R THE CHARGES ON MINIMUM AMT N IN WHICH BANK WE CAN DO IT?
Can U write a C-program to print the size of a data type without using the sizeof() operator? Explain how it works inside ?
Can a program have two main functions?
Explain how do you list a file’s date and time?
Describe newline escape sequence with a sample program?
In the below code, how do you modify the value 'a' and print in the function. You'll be allowed to add code only inside the called function. main() { int a=5; function(); // no parameters should be passed } function() { /* add code here to modify the value of and print here */ }
how to go with this?
A stack can be implemented only using array?if not what is used?
What is the difference between File pointer and Internal Charecter Pointer?