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

How do you print a string on the printer?

763


What are the differences between the function prototype and the function defi-nition?

798


Must accepts "Maestro Cards" Tax for bike should be less than 15 Total number of lanes is more than 10 Must provides monthly pass Write a method: boolean isGoodTollBridge(String[] cardsAccepted, String[] tollTax, boolean hasMonthlyPass, int numberOfLanes); String[] cardsAccepted A String array of names of card types accepted for payment of toll tax, it can be null if the toll does not accept any card String[] tollTax A String array of toll tax chart (say “Train : 300”,”BullCart : 10”) boolean hasMonthlyPass This parameter defines whether there is any monthly pass available or not int numberOfLanes This parameter defines the number of lanes for each side

3217


How many types of comments are there in c++?

742


How does list r; differs from list r();?

872






How did c++ start?

801


what are function pointers?

736


What are c++ redistributables?

758


Which operator cannot overload?

779


Explain how to initialize a const data member.

807


Explain abstraction.

807


Which bit wise operator is suitable for checking whether a particular bit is on or off?

780


What is a sequence in c++?

739


What is the difference between strcpy() and strncpy()?

823


How can you differentiate between inheritance and implementation in c++?

854