1.
#include<stdio.h>
int main()
{
int function(int);
int t=function(1); printf("\tt=%d",t);
t=function(2); printf("\tt=%d",t);
t=function(3); printf("\tt=%d",t);
return 0;
}
int function (int a)
{
int t;
t = a<<2 + a;
return t;
}
the output is
t=8 t=32 t=96
i am not able to figure out why this is happening.
can someone explain what is happening in the function() ?
2.
#include<stdio.h>
#include<math.h>
int main(main)
{
printf("\n%d",main+=pow(++main,++main));
return 0;
}
what does the above program do with "main"?
why does main take 1, initially?
3.
#include<stdio.h>
struct s
{
int si;
union U // UNION NOT ASSIGNED SPACE
{
float uf;
char uc;
};
};
main( )
{
struct s un;
printf ("\n\t%d\n", sizeof (struct s));
}
why does the above program print the sizeof(int)
though there is a union inside the struct?