Programming in C
Extensive Questions
Q.No1 Describe the following HLLs.
Ans: C:
C was developed in early 1970s by Dennis
Ritchie at Bell Laboratories. It has become one of the most popular programming
language today. It is highly structured easy
to understand and use. In past it was only used to write O.S, compiler assembler
etc. today , it is used to write all types of application programs
word-processing, spreadsheet program DBMS etc.
C++:
C++ was developed by Bjarne Stroustrup also
at Bell Laboratories during 1983-85. It is superset of C, any valid C program
is also a C++ program. C++ provide programming facilities to easily and quickly
write more powerful programs.
Visual Basic:
Visual Basic is evolved from the easier version called BASIC. VB is very
popular programming language for writing windows and web applications. It is
also used to developed business programs such as payroll system, inventory
control system. VB is also used to write programs related with engineering,
science, arts, education, games.
C#:
C sharp is developed in 2000 by Microsoft Corporation. It is simple,
modern, general purpose programming language. Syntax of C# is similar to C and
C++. It has some features of Java. It is used to write web applications. All
types of programs like game, utilities,
O.S, compiler and business Apps can also be developed using C#.
Java:
Java is high level language developed by Sun
Microsystems. It is similar to C and C++. It is used to write small programs
that can be embedded in a web page accessed through internet. It is ideal for
network computing. It is used for writing programs for wide range of devices
like computers and networks. Most of the web browsers are made java enabled,
like internet explorer and Firefox etc.
➤➤➤➤➤➤➤➤➤➤➤➤
Q.No2 Differentiate between Compiler and Interpreter.
Ans: Compiler:
It is computer software that translates
source program into object program. Source program consists of statements
written in HLLs. The source program is translated with a compiler into machine
language, the resulting program is known as object program. The object program
is understandable by machine but not by human.
Interpreter:
Interpreter translates HLL program into
machine language but it translates one instruction at a time and executes it
immediately before translating the next instruction. Its speed of translating
is slow than a compiler. Examples of programming languages that use interpreter
are Java Script, BASIC, VB and Perl.
➤➤➤➤➤➤➤➤➤➤➤➤
Q.No.3 Describe the function of linker and loader programs.
Ans: Linker:
Linker is
the software that translates object program into a single executable program.
During this process, if it could not find definition of a particular function
that is used in the program, then it would assume that it is defined in C library.
It will replace this function in the object program with the code from C
library and then creates a single executable program.
Loader:
It is a software that loads programs into memory
and then executes them.
➤➤➤➤➤➤➤➤➤➤➤➤
Q.No.4 What are the rules for specifying a variable name in C language?
Ans: The
following are the rules for specifying variable names in C language.
i.
A variable begins with a letter or underscore( _ ).
over_time.
ii.
Both upper and lower case letter are allowed for naming
variables.
iii.
Special characters cannot be used as variable name
e.g., #, ?, @ etc.
iv.
Reserved words of C cannot be used int, case, if etc.
v.
There must be no embedded blank in the name of a
variable ma ss is not correct.
➤➤➤➤➤➤➤➤➤➤➤➤
Q.No.5 What is the difference between implicit type casting and explicit type casting? Give examples.
Ans: Implicit Typecasting:
Implicit typecasting is performed automatically by the compiler without
programmer’s intervention. It converts all operands into the data type of the largest operand.
Suppose an expression contains variables of integer and double data types the
result will be evaluated to a double data type.
Example:
#include <stdio.h>
void main(void)
{
float value1 = 2.5
float value2 = 5.3;
int result;
result = value1 + value2;
printf(“Result : %d”,result);
}
Explicit
Typecasting:
Explicit casting is performed by programmer. He defines the data type in
parenthsis before the variable or expression.
Example:
#include <stdio.h>
void main(void)
{
int value1 = 30
int value2 = 7;
float result;
result = (float)value1 / value2;
printf(“Result : %f”,result);
}
➤➤➤➤➤➤➤➤➤➤➤➤
Q.No.6 What is a preprocessor? Give examples.
Ans: Preprocessor Directives:
These
are instructions for the C compiler. Every C program contains preprocessor
directives at the beginning of the program. These directives start with sign
(#). The most commonly used preprocessors are include and define.
The include Preprocessor:
It has the following syntax.
#include <header file name>
When
the preprocessor is carried out by C compiler, it will search for the header
file htat is written within the less and greater than symbols and copy it in
the source file. The header file used here is stdio.h. it includes printf() and
scanf() function prototypes.
The define Preprocessor:
It is used for defining constants in
C program. It gives meaningful name to constant value that is to be used in the
program.
It
has the following syntax.
#define SYMBOL value/expression
For example #define HEIGHT
12
➤➤➤➤➤➤➤➤➤➤➤➤
Fbise Notes-Computer | Programming in C Chapter no.02 class 10th
Reviewed by fbisenotes
on
August 18, 2019
Rating:
That is very interesting; you are a very skilled blogger. I have shared your website in my social networks! A very nice guide. I will definitely follow these tips. Thank you for sharing such detailed article.
ReplyDeletewill help you more:
There is a lot of information related to science related to our site. Please visit our site to find known and unknown information about science:
ЧТО ЖДЕТ СИСТЕМУ ОБРАЗОВАНИЯ В 2020 ГОДУ?