Tuesday, July 21, 2015

C Question Answer

Q1. Difference Between C and ansi C?

Ans.  After the development of C, it got really popular and practically became the default programming language. However, it was not working the same on various different platforms. C had been designed for the UNIX environment; hence, when run in many other platforms, some codes were returning errors. There was a need for a set of standards, which would allow the C programming language to work similarly on all platforms. Hence, the ANSI C was born.

ANSI C is a set of successive standards which were published by the American National Standards Institute (ANSI) for the C programming language. The ANSI specifies the syntax and semantics of programs written in C. It also specifies the C program's interactions with the platform via input and output data. Additionally, it also specifies restrictions and limits imposed upon conforming implementations of C language translators.


Q2. Difference between binary code and machine code?

Ans. Binary IS machine code. When you write a program in C, it's human readable, but not executable. A compiler will compile (translate) it to machine code, which is indeed executable. This machine code is sometimes called a "binary" as it is not human readable, but a stream of instructions for the processor in binary form.

Q3. What ansi stand for & who owes C?

Ans. American National Standards Institute (ANSI)


Q4. Difference between object file and executable file?

Ans. C is a compiled language so you need to translate the source code in a file that the computer can execute. This file is generated by the compiler and is called the object code ( .obj ), but a program like the "hello world" program is composed by a part that we wrote and a part of the C library. The linker links these two parts of a program and produces an executable file ( .exe ).

No comments:

Post a Comment