how to find your architecture is LittleEndian or BigEndian?
Answer / kirankumaryakkala
ans. by using unions we can find it see.
union
{
char ch[2];
int i;
}u;
u.i=512;
printf("%d %d",u.ch[0],u.ch[1]);
printf("%d",u.i);
basically u will see this type of implementation while u r
going through some C books.
depending on the storage seen at ch[0],ch[1] u can find.
u can find the output as ch[0]=0,ch[1]=2 \\little endian
(or) ch[0]=2,ch[2]=0\\bigendian
like this u can find the endian....
Is This Answer Correct ? | 3 Yes | 1 No |
How do you write a program which produces its own source code as its output?
What are the different types of linkage exist in c?
What is class and object in c?
Can i use Two or More Main Funtion in any C program.?
What is #include conio h?
Why can’t constant values be used to define an array’s initial size?
Can math operations be performed on a void pointer?
a number is perfect if it is equal to the sum of its proper divisor.. 6 is perfect number coz its proper divisors are 1,2 and three.. and 1+2+3=6... a number is deficient if the sum of its proper divisor is less than the number.. sample: 8 is deficient, coz its proper divisors are 1,2 and 4, and 1+2+4=7. abundant number, if the sum of its proper divisor is greater than the number.. sample..12 is abundant coz 1+2+3+4+6=16 which is geater than 12. now write a program that prompts the user for a number, then determines whether the number is perfect,deficient and abundant..
Is c compiled or interpreted?
Are local variables initialized to zero by default in c?
palindrome for strings and numbers----Can anybody do the prog?
6 Answers CTS, TCS, Vipro Lifescience Pvt,
how can i get the string which is having two spaces at the end.suppose the string is "Hello World ".Now at the end i have two spaces.i need to print with that spaces .