Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 the use of cmath in c++?

1016


In int main(int argc, char *argv[]) what is argv[0] a) The first argument passed into the program b) The program name c) You can't define main like that

1049


How do you add an element to a set in c++?

943


Explain dangling pointer.

1078


Can you use the function fprintf() to display the output on the screen?

1204


What do you mean by “this” pointer?

1041


Is c++ the best programming language?

973


What is #include c++?

1060


What is the difference between the parameter to a template and the parameter to a function?

1070


How do you sort a sort function in c++ to sort in descending order?

945


In what situations do you have to use initialization list rather than assignment in constructors?

1023


How a pointer differs from a reference?

1279


What is the best book for c++ beginners?

988


Is dev c++ a good compiler?

904


How const int *ourpointer differs from int const *ourpointer?

1076