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

What is a c++ object?

861


What are c++ templates used for?

879


What is ifstream c++?

811


What are the extraction and insertion operators in c++? Explain with examples.

909


Explain what is class definition in c++ ?

809


Where Malloc(), Calloc(), and realloc() does get memory?

826


What is a breakpoint?

779


What is the difference between a reference and a pointer?

827


Explain the register storage classes in c++.

898


Write a program in c++ to print the numbers from n to n2 except 5 and its multiples

2249


Which is best c++ or java?

856


Why use of template is better than a base class?

873


Should I learn c++ c?

821


why is c++ called oops? Explain

811


What are the three forms of cin.get() and what are their differences?

861