how to write a data 10 in address location 0x2000
Answers were Sorted based on User's Feedback
Answer / vishnu
int main()
{
int *ptr;
ptr = (int *)0x2000;
*ptr = 10;
printf("%d", *ptr);
}
| Is This Answer Correct ? | 5 Yes | 1 No |
The below line u can use for the question asked, provided
the address is not pointing to any OS memory, system files
or any location on ROM memory.
0x2000 is invalid address(Access voilation)in my system. So
I tried with the valid address 0x12FF70 to get the o/p.
main()
{
*(int *)(0x12FF70)= 20;
printf("%d \n",*(int *)(0x12FF70));
getch();
}
O/p would be 20.
| Is This Answer Correct ? | 1 Yes | 0 No |
What is a substring in c?
Does c have an equivalent to pascals with statement?
write a program to compare 2 numbers without using logical operators?
what are the advantages & disadvantages of unions?
Go through the following code sinippet char a[20]; a="Hello Orcale Test"; will this compile?
Differentiate call by value and call by reference?
#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }
Differentiate between calloc and malloc.
what is the hexidecimal number of 4100?
What is #pragma directive?how it is used in the program? what is its advantages and disadvantages?
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..
WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?