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


Please Help Members By Posting Answers For Below Questions

Explain union.

633


Explain the meaning of keyword 'extern' in a function declaration.

716


Why header file is used in c?

571


What is the difference between %d and %i?

590


What is the difference between if else and switchstatement

1308






How can you tell whether two strings are the same?

821


write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1

3275


Differentiate between Macro and ordinary definition.

723


When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?

579


Write a c program to demonstrate character and string constants?

1678


Are enumerations really portable?

592


Explain how does free() know explain how much memory to release?

569


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.

1056


What are qualifiers and modifiers c?

540


What is main () in c?

584