int main()
{
int *p=new int;
*p=10;
del p;
cout<<*p;
*p= 60;
cout<<*p;
}
what will be the output & why?
Answer Posted / anu
I think error will come bcoz memory allocated to *P is
already deleted d it will point to nowhere now....
Is This Answer Correct ? | 3 Yes | 5 No |
Post New Answer View All Answers
Explain union.
Explain the meaning of keyword 'extern' in a function declaration.
Why header file is used in c?
What is the difference between %d and %i?
What is the difference between if else and switchstatement
How can you tell whether two strings are the same?
write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1
Differentiate between Macro and ordinary definition.
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
Write a c program to demonstrate character and string constants?
Are enumerations really portable?
Explain how does free() know explain how much memory to release?
The program will first compute the tax you owe based on your income. User is prompted to enter income. Program will compute the total amount of tax owed based on the following: Income Tax 0 - $45,000 = 0.15 x income $45,001 - $90,000 = 6750 + 0.20 x (income – 45000) $90,001 - $140,000 = 15750 + 0.26 x (income – 90000) $140,001 - $200,000 = 28750 + 0.29 x (income – 140000) Greater than $200,000 = 46150 + 0.33 x (income – 200000) Dollar amounts should be in dollars and cents (float point numbers with two decimals shown). Tax is displayed on the screen.
What are qualifiers and modifiers c?
What is main () in c?