1. Write a c program to convert decimal number to hexadecimal number.
3. Write a c program to convert octal number to decimal number.
4. Write a c program to convert octal number to hexadecimal number.
5. Write a c program to convert hexadecimal number to decimal number.
6. Write a c program to convert hexadecimal number to octal number.
8. Write a c program to convert binary number to hexadecimal number.
9. Write a c program to convert binary number to octal number.
11. Write a c program to convert hexadecimal number to binary number.
12. Write a c program to convert octal number to binary number.
6 comments:
Can any1 please explain above program????
when you create pointer to structure lets say
struct student *ptr;
it will assign some memory address to its members such that
address of-
&ptr->roll 36857 the starting address
&ptr->name 36859 ( 36857 the starting address of roll + 2 bytes = 36859 the starting address of char name[100];)
&ptr->marks 36959 ( 36859 the starting address of name + 100 bytes = 36959 the starting address of float marks;)
so the address range for all members are 36857-36962 (coz the address range of marks is 36959 -36962 which is of 4 bytes).
ok now if you use statement as following like in above example
struct student *ptr=0;
it will assign starting address to 0 (zero) instead of 36857 such that
address of-
&ptr->roll 0
&ptr->name 2
&ptr->marks 102
so the address range of all members of structure will be now from 0 to 105 ( because marks will be stored at address 102-105 which is 4 bytes)
so ptr++ will increment to the starting address 106 of next structure variable which is equal the total size of structure.
hope this helps ...
Thanks Tim
the address range for char 102 to 105. how 105 is coming (adding 3 bytes more). Can anyone please explain??
What will be the output of this program?plz tell any1
When we increment the pointer then pointer increases a block of memory (block of memory depends on pointer data type). So here we will use this technique to calculate the size of a structure.
Post a Comment