#include<stdio.h>
int main()
{
unsigned a=25;
long unsigned b=25l;
printf("%u %lu",a,b);
}
plz help me… not understanding the role of l in b=25l; if we replace it by
b=25d; then it shows invalid suffix why?
You have forgotten to include ‘#’ ie #include<stdio.h> and then run it.
output: 25 25
%u : for unsigned integers
%lu : for unsigned long long integers
Output of the Program will be : 25 25
l or L is a special character which can be used to indicate that this is a “long” constant and not just an int constant. So, in above code, the 25 is a long constant and not an integer constant.
You can read about the other suffixes available here: Integer literal - cppreference.com
why l is not affecting the output of b?
thnks! but in b=25l; if we replace by b=25d;
then it will show invalid suffix why?..
Thanks for the link. I searched for the reason and couldn’t find it for 10 minutes. I was so confused about this after seeing this question.
thnks for the answer and link …