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's the best way to declare and define global variables?
write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.
To what value are pointers initialized? 1) NULL 2) Newly allocated memory 3) No action is taken by the compiler to initialize pointers.
can v write main() { main(); } Is it true?
Write a program in C to convert date displayed in gregorian to julian date
write an algorithm which can find the largest number among the given list using binary search ............... this was asked in the interview
2 Answers Satyam, UNIS, Wipro,
Is the exit() function same as the return statement? Explain.
0 Answers Agilent, ZS Associates,
Difference Between embedded software and soft ware?
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
Give the Output : * * * * * * * * * *
In which header file is the null macro defined?
what is printf