answersLogoWhite

0

Answer

1. When you save file using extension ".c" the program executes using "C" compiler and it cannot execute any other program which is not in "C".

So, we cannot execute program in "C" which is not in "C".

2. When you save file using extension ".cpp" the program executes using "C++" compiler and it can execute program of "C" but it should be saved with extension ".cpp".

So, There is a program which is not in "C++" can be executed in "C++" compiler.

Another answerYour question is ambiguous.

1. Okay in C++ but not in C:

int main (void)

{ cout << "Hello"; }

2. Okay in C but not in C++:

int main (void)

{

char hello [5] ="Hello";

printf ("%.5s\n", hello);

return 0;

}

Note: the question was not about the file extensions; it was about the compatibility (or lack of it) between languages C and C++. It is a well-known fact that many (but not every) C programs can be compiled with a C++ compilers.

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Is C plus plus interpreted as the program is executed?

No. Neither C nor C++ are interpreted. Both need to be compiled and linked to produce highly-optimised machine code, which is then executed.


Why there is one main function in c?

Because that's what is executed when you run the program.


What is a main function in c plus plus?

It is the first function that gets called when the program is executed.


Write a c program that will exchange the values of x and y after the statement executed x is equal to y and y is equal to x?

what is a program x and y


When does program become a process?

When it is executed.


How do you use a c program-continue statement in a block not in a loop?

You can use it like an usual operator. Everything (in the same block) after continue will not be executed.


What is actual path of execution of a program?

how programs are executed? Let we take C, how a c program is executing.... A first step we have to install a particular software for a execution so here we are installing turbo c then open the bin folder after the installation ,you will find on executable file named TC.exe it will look like a command prompt that only executing your c program files and giving another executable file for your program as output. to check fisrt create any simple program and first compile it and see the bin folder you will find one file named filename.obj and then run that program and now you will find another file filename.exe,that is an output file.


How high level program is executed?

High-level programs cannot be executed directly, they must be compiled in advance of execution, or interpreted by a runtime program.


What is a computer program made of?

A computer program contains instructions, to be executed by a computer.


Is it possible to execute a program even after it exits from the main?

Of course, a program be executed repeatedly.


Write a program to adentify whether a character entered by a user is a vowel or a consonant?

You can check the value of a character by using if statements.Also, note that this code does not check for capital letters./* code */#include int main(){char c;c = getc(stdin);if (c 'o') {/* If the character is a vowel, this code will be executed. */} else if (c >= 'a' && c


Why must the server program be executed before the client program?

A server program must be executed before the client program because once a client is run, it will attempt to initiate a connection with the server. If the server is down, then the client will not be able to make a connection.