If you are not having a sizeof operator in C, how will you get to know the size of an int ? Click for Solution |
-
Warning: Illegal string offset 'name' in /home/prepdo6/gpl4you/discussquessub.php on line 681
A java;script:
Warning: Illegal string offset 'name' in /home/prepdo6/gpl4you/discussquessub.php on line 681
A #define sizeof_macro(int) ((unsigned)((int *)0 + 1))
Warning: Illegal string offset 'name' in /home/prepdo6/gpl4you/discussquessub.php on line 681
A void main() { int *p=0; printf("%p",++p); }
CpjJwWHV nitin ji, in this code you have considered that if stepsize is 2 then it will be integer. but this stepsize of 2 we know due to nature of integer in C. 14 years ago CpjJwWHV i have used another logic it will work.
#include<stdio.h>
#include<conio.h>
void main()
{
int x;
unsigned int m;
int c;
clrscr();
printf("enter a number.........");
scanf("%d",&x);
m=x|(~0);
printf("\nvalue of m=%u",m);
for(c=1;c<100;c++)
{
m=m<<1;
if(m==0)
break;
}
printf("size ofx=%d bits",c);
getch();
}14 years ago
Explore
- GPL4you
- Home
- Prepdoor - Online Mock Test
- About
- FAQs
- Contact
- Contact Us
© 2011 - gpl4you | All Rights Reserved.