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

Answer Posted / aashish kumar nath

We can do many programs which will run in C but not in C++
like if we declare

int class=8 /*It will run in C but not in c++ */

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is main function in c++ with example?

804


What is algorithm in c++ programming?

784


Can I learn c++ without learning c?

750


How would you call C functions from C++ and vice versa?

823


Explain terminate() and unexpected() function?

818


What do you mean by ‘void’ return type?

818


Explain this pointer?

773


What are put and get pointers?

826


Arrange Doubly linked list in the ascending order of its integral value and replace integer 5 with 7?

3905


A prime number is a number which is divisible only by itself and 1. Examples of the first few primes are 2, 3, 5, 7, 11. Consider writing a program which can generate prime numbers for you. Your program should read in and set a maximum prime to generate and a minimum number to start with when looking for primes. This program should be able to perform the following tasks: 1. Read the maximum number from user (keyboard input) to look for primes. The program should not return any primes greater than this number. 2. Read the minimum number from user (keyboard input) to look for primes. The program should not return any primes less than this number. 3. Generate and print out every prime number between the maximum prime and minimum number specified by the user.

1935


Why iomanip is used in c++?

844


True or false, if you keep incrementing a variable, it will become negative a) True b) False c) It depends

2094


What is the use of register keyword with the variables?

739


Is c++ still being used?

768


What are literals in C++?

777