Write any small program that will compile in "C" but not
in "C++"

Answer Posted / balasubramani

main()
{
char a;
printf("string:");
scanf("%s",a);
getch();
}

this is correct if v compile in c
but it results in error when u code xactly the same in cpp
bcoz cpp needs cout n cin instead of printf n scanf :D lol

Is This Answer Correct ?    2 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why is polymorphism useful?

569


Which software is used to run c++ program?

554


How does a C++ structure differ from a C++ class?

628


Explain the use of this pointer?

640


What is the purpose of the "delete" operator?

624






How a new operator differs from the operator new?

626


Explain terminate() and unexpected() function?

630


How is new() different from malloc()?

635


What jobs can you get with a c++ certification?

588


How a modifier is similar to mutator?

648


Define pre-condition and post-condition to a member function in c++?

667


Is string data type in c++?

589


What is a pointer how and when is it used?

580


What is a breakpoint?

563


What is the use of endl in c++?

599