SlideShare a Scribd company logo
COMPUTER PROGRAMMING QUESTIONS
1) What is C language?
C is a programming language developed at AT & T’s Bell Laboratories of USA in
1972.The C programming language is a standardized programming language
developed.
2) What is an algorithm?
An algorithm is a step-by-step method of performing any task.
3) What is a flow chart?
A flowchart is a type of diagram that represents an algorithm or process, showing the
steps as boxes of various kinds, and their order by connecting these with arrows.
4) What is a C Preprocessor?
C Preprocessor is a program that processes our source program before it is passed to
the compiler.
5) What is the use of header files as used in C programming?
Header files are used to have declarations.It is simple to include a single header file
than writing all the needed functions prototypes.
6) What is the Structure of a C Program?
 Documentation Section
 Linking Section
 Definition Section
 Global declaration Section
 main function
 subprogram section.
7) Explain some Header Files?
stdio.h This is standard i/o header file in which Input/Output functions are declared
conio.h This is console input/output header file
string.h All string related functions are defined in this header file
stdlib.h This header file contains general functions used in C programs
math.h All maths related functions are defined in this header file
8) What is the use of main() function?
main() is the starting point of program execution.
9) What are the types of constants in c?
C constants can be divided into two categories:
1. Primary constants (Numerical)
2. Secondary constants (Character)
10)What is a Compiler?
A compiler is a computer program that transforms source code written in a
programming language into another computer language
11)What is a Token in C?
A Token is the basic building block of a C.
C Tokens are:Key Words, Identifier, Constants, String – literal, Operator, Punctuators
12)What are Printf() and scanf() Functions :
printf() function is used to print the “character, string, float, integer, octal and
hexadecimal values” onto the output screen.
scanf() function is used to read character, string, numeric data from keyboard
13)What is a Data Type and List the different Data types?
C data types are defined as the data storage format that a variable can store a data to
perform a specific operation.
List of Data Types:
1. Basic Data Types: Int, Float, Char, Double, long int
2. Enumeration Data Type: enum
3. Derived Data Type: Pointer, array, structure, union
4. Void Data Type: void
14)What is Integer Data Type?
Integer data type allows a variable to store numeric values.
 The storage size of int data type is 2 or 4 or 8 byte.
 int (2 byte) can store values from -32,768 to +32,767
 int (4 byte) can store values from -2,147,483,648 to +2,147,483,647.
15) What is enum Data Type?
 Enumeration data type consists of named integer constants as a list.
 It start with 0 (zero) by default and value is incremented by 1 for the sequential
identifiers in the list.
16)What is a Void Data Type?
Void is an empty data type that has no value.
17)What is a comment in C?
Comments are like helping text in your C program and they are ignored by the compiler.
We can write in between /* and */ or // (Line Comments)
18)What is an Identifier in C?
C identifier is a name used to identify a variable,function,or any other user defined item.
19)What is a Key word in C?
Keywords are reserved words in C and Keywords are may not be used as constant or
variable or any other identifier names.
some of the Keywords:
Else,long,break,char,float.
20)Define a Variable?
A variable is nothing but a name given to a storage area that our programs can
manipulate.Each variable in C has a specific type, which determines the size and layout
of the variable's memory.
21)What are the steps to develop a C Program?
 Specifying the problem statement
 Designing an algorithm
 Coding
 Debugging
 Testing and Validating
 Documentation and Maintenance.
22)What is the process of debugging or compilation for C Programs?
To check the errors in a program is called debugging done by 4 stage:
1. Checking Syntactic Errors
2. Checking Run time Errors/ Linkage Errors
3. Checking Linker Errors
4. Checking Logical Errors
23) What is an Operator and list different types of operators in C?
The symbols which are used to perform logical and mathematical operations in a C
program are called C operators.
different operators in C:
 Arithmetic operators
 Relational operators
 Logical operators
 Assignment operators
 Increment and Decrement operators
 Conditional operators
 Bitwise operators
 Special operators.
24)What are Special Operators?
 &(Address Operator)
 *(Pointer Operator)
 Sizeof()
25)What is sizeof operator?
It returns the number of bytes the operand occupies.
26) What is pre-increment or post-increment?
++n (pre increment) increments n before its value is used in an assignment operation
or any expression containing it.
n++ (post increment) does increment after the value of n is used.
27)What is type casting?
Converting a variable of one type to another type.
28)What are the Format Specifiers or Type Specifiers or Conversion Specifiers?
 %d (Integer)
 %f (Float)
 %c (Character)
 %l (Long Integer)
 %s (Strings)
 %u (Address with decimal value)
 %p (Address with Hexa Decimal Value in Small Letters)
 %x ((Address with Hexa Decimal Value in Capital Letters)
29)What is a Statement in C?
A statement is a block of code that does something.
30)Different Types of Statements?
 Null Statement
 Expression Statement
 Compound Statement
 Return Statement
 Conditional Statements
 Iterative or Looping Statements
 Unconditional Statements
31)What are different types of conditional statements?
 If Statement
 If else statement
 Nested- if else statement
 Switch Statement
32)What is Looping Statements?
Looping statement which executes the statements with in the compound statement by
checking the condition, and performs same set of statements as a loop until the
condition false.
Looping Statements are: While, do-while, for
33)What is the difference between for loop and while loop?
For Loop:execute a set of statements in fixed number of times.
While loop:when the number of iterations to be performed is not known in advance.
34)What are Unconditional Statements?
 goto and labeled statements
 break Statement
 continue Statement.
35)Define goto and labeled Statement.,Break Statement,Continue Statement
The goto statement transfers control to a label. The given label must reside in the same
function and can appear before only one statement in the same function.
The break statement terminates the execution of the nearest enclosing do, for, switch,
or while statement in which it appears. Control passes to the statement that follows the
terminated statement.
The continue statement passes control to the next iteration of the nearest enclosing
do, for, or while statement in which it appears
36)Define Type Qualifiers, and list them?
The keywords which are used to modify the properties of a variable are called
typequalifiers.There are two types of qualifiers available in C language.They are,1)
const 2)volatile
37) Define const Keyword?
Constants are also like normal variables. They refer to fixed values. They are alsocalled
as literals.
38)Define volatile Keyword?
When a variable is defined as volatile, the program may not change the value of the
variable explicitly.
39)Define Storage class?
Storage class specifiers in C language tells the compiler where to store a variable, how
to store the variable, what is the initial value of the variable and life time of the variable.
40)What are Different Storage Classes?
There are 4 storage class specifiers available in C language. They are,
1. Auto
2. Extern
3. Static
4. Register
41)Define Array?
An Array is a collection of Homogeneous or similar data type elements having unique
values, and stored data different locations.You can store group of data of same data
type in an array.
Types of an Array:
There are 2 types of C arrays. They are,
1) One dimensional array
2) Multi dimensional array
a) Two dimensional array
b) Three dimensional array, four dimensional array etc…
42)Define a String?
C Strings are nothing but array of characters ended with null character (‘0’).Strings are
always enclosed by double quotes. Whereas, character is enclosed by single quotes in
C.
43)Define Pointer?
C Pointer is a variable that stores/points the address of another variable. C Pointer is
used to allocate memory dynamically i.e. at run time.
44) What is a pointer value and address? pointer to pointer?
 A pointer value is a data object that refers to a memory location. Each memory
location is numbered in the memory.
 The number attached to a memory location is called the address of the location.
 If a pointer variable points another pointer value. Such a situation is known as a
pointer to a pointer.
45) What are the Advantages of Functions?
 It reduces the Complexity in a program by reducing the code.
 Function are easily understanding and reliability and execution is faster.
46)What is Recursion?
A recursion function is one which calls itself either directly or indirectly it must halt at a
definite point to avoid infinite recursion.
47) What is an Argument?
An argument is an entity used to pass data from the calling to a called function.
48) Define Function Declaration, Function Call and Function Definition.
 Function declaration - This informs compiler about the function name, function
parameters and return value’s data type.
 Function call – This calls the actual function
 Function definition – This contains all the statements to be executed.
49)Define Call by Value and Call by Reference?
In call by value method, the value of the variable is passed to the function as
Parameter.
In call by reference method, the address of the variable is passed to the function as
parameter.
50) List some MATH.H Functions?
1. abs ( )
2. floor ( )
3. round.(.)
4. ceil ( )
5. sqrt ( )
6. pow ( )
7. trunc()

More Related Content

PPTX
Plasma display
PDF
communication interfaces-Embedded real time systems
PPTX
Internal Architecture of 8086| msbte sem 4 microprocessor
PDF
Unit-1 basics of computer graphics
PPTX
embedded system and AVR
PPT
Basic System Properties.ppt
PPTX
Alcohol detector
PPTX
AVR ATmega32
Plasma display
communication interfaces-Embedded real time systems
Internal Architecture of 8086| msbte sem 4 microprocessor
Unit-1 basics of computer graphics
embedded system and AVR
Basic System Properties.ppt
Alcohol detector
AVR ATmega32

What's hot (20)

PDF
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
PPTX
Code Conversion in 8085 Microprocessor
PDF
8279 d
PDF
8155 PPI
PPTX
Computer Organization
PPTX
Programmable dma controller 8237
PPTX
Addressing modes 8085
DOC
Digital Signal Processing Lab Manual
PPTX
Assembly Language
PPTX
8237 dma controller
PDF
Microcontroller pic 16 f877 registers memory ports
PPTX
8051 microcontroller features
PPTX
8251 USART
PDF
Memory segmentation-of-8086
PDF
Vx works RTOS
PPT
Vestigial side band (vsb)
PPTX
PPTX
Introducion to MSP430 Microcontroller.pptx
PDF
rotational matrix.pdf
PPTX
Introduction to arm processor
CS304PC:Computer Organization and Architecture Unit- III PDF notes .pdf
Code Conversion in 8085 Microprocessor
8279 d
8155 PPI
Computer Organization
Programmable dma controller 8237
Addressing modes 8085
Digital Signal Processing Lab Manual
Assembly Language
8237 dma controller
Microcontroller pic 16 f877 registers memory ports
8051 microcontroller features
8251 USART
Memory segmentation-of-8086
Vx works RTOS
Vestigial side band (vsb)
Introducion to MSP430 Microcontroller.pptx
rotational matrix.pdf
Introduction to arm processor
Ad

Similar to Computer programming questions (20)

PDF
Pc module1
PDF
Cp viva q&a
PDF
Interview Questions For C Language
PDF
C Programming Language Introduction and C Tokens.pdf
PPTX
Interview Questions For C Language .pptx
PDF
introduction to programming using ANSI C
PPTX
unit 1 cpds.pptx
PPTX
Programming_in_C_language_Unit5.pptx course ATOT
PPTX
program fundamentals using python1 2 3 4.pptx
PDF
CSharpCheatSheetV1.pdf
PPTX
c & c++ logic building concepts practice.pptx
PDF
C programming notes
PDF
Unit 2 introduction to c programming
PPTX
Introduction to c
PDF
C programming notes.pdf
PDF
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
DOCX
Dot net programming concept
PPTX
Team-7 SP.pptxdfghjksdfgduytredfghjkjhgffghj
PPTX
Unit2_1.pptx Introduction to C# Language features
PPTX
Unit 1:DOT NET Framework CLR(Common Language Runtime )
Pc module1
Cp viva q&a
Interview Questions For C Language
C Programming Language Introduction and C Tokens.pdf
Interview Questions For C Language .pptx
introduction to programming using ANSI C
unit 1 cpds.pptx
Programming_in_C_language_Unit5.pptx course ATOT
program fundamentals using python1 2 3 4.pptx
CSharpCheatSheetV1.pdf
c & c++ logic building concepts practice.pptx
C programming notes
Unit 2 introduction to c programming
Introduction to c
C programming notes.pdf
C Language Interview Questions: Data Types, Pointers, Data Structures, Memory...
Dot net programming concept
Team-7 SP.pptxdfghjksdfgduytredfghjkjhgffghj
Unit2_1.pptx Introduction to C# Language features
Unit 1:DOT NET Framework CLR(Common Language Runtime )
Ad

Recently uploaded (20)

PPT
Lines and angles cbse class 9 math chemistry
PPTX
Fundamentals of Computer.pptx Computer BSC
PPTX
Entre CHtzyshshshshshshshzhhzzhhz 4MSt.pptx
PPTX
material for studying about lift elevators escalation
PPTX
title _yeOPC_Poisoning_Presentation.pptx
PDF
Dynamic Checkweighers and Automatic Weighing Machine Solutions
PPTX
1.pptxsadafqefeqfeqfeffeqfqeqfeqefqfeqfqeffqe
PPTX
Lecture-3-Computer-programming for BS InfoTech
DOCX
fsdffdghjjgfxfdghjvhjvgfdfcbchghgghgcbjghf
PPTX
Computers and mobile device: Evaluating options for home and work
PPTX
了解新西兰毕业证(Wintec毕业证书)怀卡托理工学院毕业证存档可查的
PPTX
5. MEASURE OF INTERIOR AND EXTERIOR- MATATAG CURRICULUM.pptx
PPTX
Sem-8 project ppt fortvfvmat uyyjhuj.pptx
PDF
-DIGITAL-INDIA.pdf one of the most prominent
PPTX
Syllabus Computer Six class curriculum s
PPTX
Embedded for Artificial Intelligence 1.pptx
PPTX
Lecture 3b C Library _ ESP32.pptxjfjfjffkkfkfk
PDF
How NGOs Save Costs with Affordable IT Rentals
PPTX
DEATH AUDIT MAY 2025.pptxurjrjejektjtjyjjy
PPTX
INFERTILITY (FEMALE FACTORS).pptxgvcghhfcg
Lines and angles cbse class 9 math chemistry
Fundamentals of Computer.pptx Computer BSC
Entre CHtzyshshshshshshshzhhzzhhz 4MSt.pptx
material for studying about lift elevators escalation
title _yeOPC_Poisoning_Presentation.pptx
Dynamic Checkweighers and Automatic Weighing Machine Solutions
1.pptxsadafqefeqfeqfeffeqfqeqfeqefqfeqfqeffqe
Lecture-3-Computer-programming for BS InfoTech
fsdffdghjjgfxfdghjvhjvgfdfcbchghgghgcbjghf
Computers and mobile device: Evaluating options for home and work
了解新西兰毕业证(Wintec毕业证书)怀卡托理工学院毕业证存档可查的
5. MEASURE OF INTERIOR AND EXTERIOR- MATATAG CURRICULUM.pptx
Sem-8 project ppt fortvfvmat uyyjhuj.pptx
-DIGITAL-INDIA.pdf one of the most prominent
Syllabus Computer Six class curriculum s
Embedded for Artificial Intelligence 1.pptx
Lecture 3b C Library _ ESP32.pptxjfjfjffkkfkfk
How NGOs Save Costs with Affordable IT Rentals
DEATH AUDIT MAY 2025.pptxurjrjejektjtjyjjy
INFERTILITY (FEMALE FACTORS).pptxgvcghhfcg

Computer programming questions

  • 1. COMPUTER PROGRAMMING QUESTIONS 1) What is C language? C is a programming language developed at AT & T’s Bell Laboratories of USA in 1972.The C programming language is a standardized programming language developed. 2) What is an algorithm? An algorithm is a step-by-step method of performing any task. 3) What is a flow chart? A flowchart is a type of diagram that represents an algorithm or process, showing the steps as boxes of various kinds, and their order by connecting these with arrows. 4) What is a C Preprocessor? C Preprocessor is a program that processes our source program before it is passed to the compiler. 5) What is the use of header files as used in C programming? Header files are used to have declarations.It is simple to include a single header file than writing all the needed functions prototypes. 6) What is the Structure of a C Program?  Documentation Section  Linking Section  Definition Section  Global declaration Section  main function  subprogram section. 7) Explain some Header Files? stdio.h This is standard i/o header file in which Input/Output functions are declared conio.h This is console input/output header file string.h All string related functions are defined in this header file stdlib.h This header file contains general functions used in C programs math.h All maths related functions are defined in this header file
  • 2. 8) What is the use of main() function? main() is the starting point of program execution. 9) What are the types of constants in c? C constants can be divided into two categories: 1. Primary constants (Numerical) 2. Secondary constants (Character) 10)What is a Compiler? A compiler is a computer program that transforms source code written in a programming language into another computer language 11)What is a Token in C? A Token is the basic building block of a C. C Tokens are:Key Words, Identifier, Constants, String – literal, Operator, Punctuators 12)What are Printf() and scanf() Functions : printf() function is used to print the “character, string, float, integer, octal and hexadecimal values” onto the output screen. scanf() function is used to read character, string, numeric data from keyboard 13)What is a Data Type and List the different Data types? C data types are defined as the data storage format that a variable can store a data to perform a specific operation. List of Data Types: 1. Basic Data Types: Int, Float, Char, Double, long int 2. Enumeration Data Type: enum 3. Derived Data Type: Pointer, array, structure, union 4. Void Data Type: void 14)What is Integer Data Type? Integer data type allows a variable to store numeric values.  The storage size of int data type is 2 or 4 or 8 byte.  int (2 byte) can store values from -32,768 to +32,767  int (4 byte) can store values from -2,147,483,648 to +2,147,483,647.
  • 3. 15) What is enum Data Type?  Enumeration data type consists of named integer constants as a list.  It start with 0 (zero) by default and value is incremented by 1 for the sequential identifiers in the list. 16)What is a Void Data Type? Void is an empty data type that has no value. 17)What is a comment in C? Comments are like helping text in your C program and they are ignored by the compiler. We can write in between /* and */ or // (Line Comments) 18)What is an Identifier in C? C identifier is a name used to identify a variable,function,or any other user defined item. 19)What is a Key word in C? Keywords are reserved words in C and Keywords are may not be used as constant or variable or any other identifier names. some of the Keywords: Else,long,break,char,float. 20)Define a Variable? A variable is nothing but a name given to a storage area that our programs can manipulate.Each variable in C has a specific type, which determines the size and layout of the variable's memory. 21)What are the steps to develop a C Program?  Specifying the problem statement  Designing an algorithm  Coding  Debugging  Testing and Validating  Documentation and Maintenance. 22)What is the process of debugging or compilation for C Programs? To check the errors in a program is called debugging done by 4 stage: 1. Checking Syntactic Errors 2. Checking Run time Errors/ Linkage Errors 3. Checking Linker Errors 4. Checking Logical Errors
  • 4. 23) What is an Operator and list different types of operators in C? The symbols which are used to perform logical and mathematical operations in a C program are called C operators. different operators in C:  Arithmetic operators  Relational operators  Logical operators  Assignment operators  Increment and Decrement operators  Conditional operators  Bitwise operators  Special operators. 24)What are Special Operators?  &(Address Operator)  *(Pointer Operator)  Sizeof() 25)What is sizeof operator? It returns the number of bytes the operand occupies. 26) What is pre-increment or post-increment? ++n (pre increment) increments n before its value is used in an assignment operation or any expression containing it. n++ (post increment) does increment after the value of n is used. 27)What is type casting? Converting a variable of one type to another type. 28)What are the Format Specifiers or Type Specifiers or Conversion Specifiers?  %d (Integer)  %f (Float)  %c (Character)  %l (Long Integer)  %s (Strings)  %u (Address with decimal value)  %p (Address with Hexa Decimal Value in Small Letters)  %x ((Address with Hexa Decimal Value in Capital Letters)
  • 5. 29)What is a Statement in C? A statement is a block of code that does something. 30)Different Types of Statements?  Null Statement  Expression Statement  Compound Statement  Return Statement  Conditional Statements  Iterative or Looping Statements  Unconditional Statements 31)What are different types of conditional statements?  If Statement  If else statement  Nested- if else statement  Switch Statement 32)What is Looping Statements? Looping statement which executes the statements with in the compound statement by checking the condition, and performs same set of statements as a loop until the condition false. Looping Statements are: While, do-while, for 33)What is the difference between for loop and while loop? For Loop:execute a set of statements in fixed number of times. While loop:when the number of iterations to be performed is not known in advance. 34)What are Unconditional Statements?  goto and labeled statements  break Statement  continue Statement. 35)Define goto and labeled Statement.,Break Statement,Continue Statement The goto statement transfers control to a label. The given label must reside in the same function and can appear before only one statement in the same function. The break statement terminates the execution of the nearest enclosing do, for, switch, or while statement in which it appears. Control passes to the statement that follows the terminated statement.
  • 6. The continue statement passes control to the next iteration of the nearest enclosing do, for, or while statement in which it appears 36)Define Type Qualifiers, and list them? The keywords which are used to modify the properties of a variable are called typequalifiers.There are two types of qualifiers available in C language.They are,1) const 2)volatile 37) Define const Keyword? Constants are also like normal variables. They refer to fixed values. They are alsocalled as literals. 38)Define volatile Keyword? When a variable is defined as volatile, the program may not change the value of the variable explicitly. 39)Define Storage class? Storage class specifiers in C language tells the compiler where to store a variable, how to store the variable, what is the initial value of the variable and life time of the variable. 40)What are Different Storage Classes? There are 4 storage class specifiers available in C language. They are, 1. Auto 2. Extern 3. Static 4. Register 41)Define Array? An Array is a collection of Homogeneous or similar data type elements having unique values, and stored data different locations.You can store group of data of same data type in an array. Types of an Array: There are 2 types of C arrays. They are, 1) One dimensional array 2) Multi dimensional array a) Two dimensional array b) Three dimensional array, four dimensional array etc…
  • 7. 42)Define a String? C Strings are nothing but array of characters ended with null character (‘0’).Strings are always enclosed by double quotes. Whereas, character is enclosed by single quotes in C. 43)Define Pointer? C Pointer is a variable that stores/points the address of another variable. C Pointer is used to allocate memory dynamically i.e. at run time. 44) What is a pointer value and address? pointer to pointer?  A pointer value is a data object that refers to a memory location. Each memory location is numbered in the memory.  The number attached to a memory location is called the address of the location.  If a pointer variable points another pointer value. Such a situation is known as a pointer to a pointer. 45) What are the Advantages of Functions?  It reduces the Complexity in a program by reducing the code.  Function are easily understanding and reliability and execution is faster. 46)What is Recursion? A recursion function is one which calls itself either directly or indirectly it must halt at a definite point to avoid infinite recursion. 47) What is an Argument? An argument is an entity used to pass data from the calling to a called function. 48) Define Function Declaration, Function Call and Function Definition.  Function declaration - This informs compiler about the function name, function parameters and return value’s data type.  Function call – This calls the actual function  Function definition – This contains all the statements to be executed. 49)Define Call by Value and Call by Reference? In call by value method, the value of the variable is passed to the function as Parameter. In call by reference method, the address of the variable is passed to the function as parameter.
  • 8. 50) List some MATH.H Functions? 1. abs ( ) 2. floor ( ) 3. round.(.) 4. ceil ( ) 5. sqrt ( ) 6. pow ( ) 7. trunc()