output of the program

#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?

1 Like

You have forgotten to include ‘#’ ie #include<stdio.h> and then run it.
output: 25 25

why l is not affecting the output of b?

%u : for unsigned integers
%lu : for unsigned long long integers

Output of the Program will be : 25 25

thnks! but in b=25l; if we replace by b=25d;
then it will show invalid suffix why?..

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: http://en.cppreference.com/w/cpp/language/integer_literal#The_type_of_the_literal

1 Like

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.

1 Like

thnks for the answer and link …

1 Like