Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
12 views

Problem Solving Using C - question bank

The document outlines the course 'Problem Solving Using C' with objectives focused on programming concepts, algorithm importance, program design, file management, and understanding of control statements, functions, and arrays. It details course outcomes that include designing algorithms, analyzing data types, applying control statements, and exploring pointers. Additionally, the course content is structured into units covering fundamental algorithms, C programming basics, operators, arrays, functions, user-defined data types, and file management, along with a question bank for assessment.

Uploaded by

thegamer3167
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Problem Solving Using C - question bank

The document outlines the course 'Problem Solving Using C' with objectives focused on programming concepts, algorithm importance, program design, file management, and understanding of control statements, functions, and arrays. It details course outcomes that include designing algorithms, analyzing data types, applying control statements, and exploring pointers. Additionally, the course content is structured into units covering fundamental algorithms, C programming basics, operators, arrays, functions, user-defined data types, and file management, along with a question bank for assessment.

Uploaded by

thegamer3167
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Problem Solving Using C - B21DA0103

Course Objectives:

The objectives of this course are to:

1. Explain the basic programming concepts.


2. Illustrate the importance of Algorithm to write the Program (in small steps).
3. Describe how a good program design can reduce coding and debugging time.
4. Explain the concepts of Files for application data maintenance
5. Equip with detailed understanding of control statements, function and arrays.
6. Illustrate the use of pointers and Strings.

Course Outcomes:

By the end of the course, the students will be able to

1. Design Algorithms and Draw Flowcharts to model solving real world problems. List various
data types and operators and develop programs to evaluate arithmetic expressions and
mathematical functions.
2. Analyse various data types and operators and develop programs to evaluate arithmetic
expressions and solving mathematical functions using library functions.
3. Identify and analyse the suitable control statements and apply logical reasoning to implement
the solution for any mathematical and logical problem
4. Analyse different data structures such as arrays (1D and 2D) and its derived data structures
to handle list of data such as string (text) processing.
5. Compare and Apply different categories of user defined functions to solve problems and to
implement the concept of procedural and modular programming
6. Explore pointers in implementing programs, especially in memory management and file
handling for faster execution of programs
Problem Solving Using C - B21DA0103

Problem Solving Using C - B21DA0103


Course Content
UNIT -1: Computer Problem-Solving& Fundamental Algorithms: Computer Basics,
Introduction to Computer Problem-Solving, Fundamental Algorithms: Introduction,
Exchanging the Values of Two variables, Counting, Summation of a Set of Numbers, Factorial
Computation, Generation of the Fibonacci Sequence.
Basics Of C Programming: Overview of C: History of C, Importance of C, Basic Structure
of C Programs, Constants, Variables and Data Types-: Introduction, Character Set, C Tokens,
Keywords and Identifiers, Constants, Variables, Data Types, Declaration of Variables,
Declaration of Storage Class, Assigning Values to Variables.
UNIT – 2:
Operators and Expressions: Introduction, Arithmetic Operators, Relational Operators, Logical
Operators, Assignment Operators, Increment and Decrement Operators, Conditional Operator,
Bitwise Operators, Special Operators, Arithmetic Expressions, Evaluation of Expressions,
Precedence of Arithmetic Operators. Structured Constructs: Decision Making and Branching,
Decision Making and Looping.
UNIT– 3: [10 Hours]
Arrays &Functions: Arrays: Introduction, One-Dimensional Arrays, Initialization of One-
Dimensional Arrays, Two Dimensional Arrays, Initializing Two Dimensional Arrays, Multi-
Dimensional Arrays, Character, Arrays and Strings: Introduction, Declaring and Initializing
String Variables, Reading Strings from Screen, Writing Strings to Screen, String-Handling
Functions.
User-Defined Functions: Introduction, Need for User defined Functions-Elements of User
defined Functions, Definition of Functions, Return Values and their types, Function Calls,
Function Declaration, Category of Functions, No arguments and No return values, Arguments
but No return values, Arguments with return values, No arguments but returns a value,
Recursion.
UNIT-4:
User Defined Data Types: Structures and Unions: Introduction, defining a Structure,
Declaring Structure Variables, Accessing Structure Members, Structure Initialization, Copying
and Comparing Structure Variables, Operations on Individual Members, Arrays of Structures,
Arrays with Structures, Structures within Structures, Unions. Introduction to Pointers:
Introduction and Understanding pointers, Accessing the address of a variable, Declaring
pointer variables, Initialization of pointer variables, Accessing a variable through its pointer.
File Management in C: Introduction, Defining and Opening a File, Closing a File, Input/
Output Operations on Files
Problem Solving Using C - B21DA0103

Text Books:
1. V. Rajaraman, Neeharika Adabala, “Fundamentals of Computers”, 6th Edition, PHI, 2015.
(Chapter 1)
2. R.F Dromey, “How to Solve it by Computer” Pearson, Fourteenth Impression, 2013.
(Chapter 1 & 2)
3. E. Balaguruswamy, “Programming In ANSI C”, 3rd edition, McGraw Hill Education, 2006.
(Chapter
1 to 12).
References Books:
1. Mahapatra, “Thinking in C”, PHI Publications, 1998.
2. Yashwant Kanetkar, “Let Us C”, 13th Edition, PHP, 2013.
3. Ashok N. Kamthane, “Programming with ANSI and Turbo C”, Pearson Education, 6th
Impression, 2009.
4. Anami, Angadi, and Manvi, “Computer Concepts and C Programming – A Holistic
approach”, PHI - 2008.
Problem Solving Using C - B21DA0103

Problem Solving Using C - B21DA0103

Question Bank
Unit 1

1.Define the following: 4 Marks


a) Algorithm
b) Flowchart
2. What is an algorithm? Write an algorithm to swap two numbers using
temporary variable. 4 Marks
3.List out the basic categories of Data types and explain each one of them. 4
Marks.
4.Write a C program to convert temperature in Fahrenheit to Celsius using the
formula C= (F-32) / 1.8. 4 Marks
5. What is variable? Give the rules for variable declaration. 4 Marks
6. What is Variable? Discuss briefly various rules to be followed while
constructing variables. 5 Marks
7.Write an algorithm and flowchart to generate Fibonacci series of numbers up to
'n'. 5 Marks
8. What is flowchart? Explain different symbols used for flowchart. 6 Marks
9. Write an Algorithm and C Program to find the area of Triangle. 10 Marks
10.Write a program in C that asks from user to enter marks obtained in 5 subjects
to calculate and print his/her grade based on the average marks. 7 Marks
11. Define: Data types. Describe the various built in data types available in C
along with datatype modifiers. 7 Marks
12.Explain briefly the structure of C Program. 10 Marks
13. Explain Briefly about five operators of C with an example. 10 Marks.
14. Write an algorithm, flowchart and C program to find the sum of numbers from
1 to n.
15.Write a program to perform swapping of two numbers without using
temporary variable 5 Marks
Problem Solving Using C - B21DA0103

16. Write the structure of C program and explain. 5 Marks


17. Define algorithm. Write algorithm for finding factorial of a number 10 Marks
18. What is flowchart? Explain different symbols used for flowchart. 6 Marks
19. What is constant? Explain different constants in C. 6 Marks
20. Define flowchart. Explain various notations used to draw a flowchart. 4
21. Draw the flowchart to find the greatest of three numbers. 5 Marks
22. Write an algorithm and flowchart to find whether the given number is prime
or not. 5 Marks.
22.What is an algorithm? Write an algorithm to add two numbers and display
the result. 4
23.Explain the basic structure of C program with an example. 7
24. Evaluate the expression
i)5-8/2+9*4+8/4-7+1 4
ii)(-5*2/(6+4-2)+(2/3+5)
25. Evaluate the expression 2*((8%5) *(4+(15-3)/(4+2)))
26.Evaluate the expression 100/20<=10-5+100%10-20==5>=1! =20
27. Evaluate the expression a+2>b&&! c\\a! =d&&a-2<=e
28. A token is a smallest unit of a program. Justify your answer. Explain in
detail various tokens in c with the help of example.
29.Write a program to find factorial of a number and reverse of an integer.
30. What are tokens? Explain the various types of tokens. What are the
identifiers forming rules? 7
Problem Solving Using C - B21DA0103

Unit 2
1. Discuss the types of Looping Statement with help of example.
2. Explain increment and decrement operators in C with examples. 4
3. Write briefly about different types of operators. Write a program for a
calculator using arithmetic operator.
4. Bring out the difference between ‘=’ and ‘==’ in C with an example. 4
5. Explain Different Selection Statement with help of example.
6. Describe Nested If-else statement with suitable example.
7. With syntax, explain entry controlled and exit controlled loops. 7
8. Demonstrate the usage of a switch statement with an example.
9. Write a short note on break and Goto Statement.
10.When is a SWITCH statement can be better than an IF statement? Justify
with an example. 4
11.Differentiate between While Loop and Do-While Loop. 10 Marks
12.Write a C program to largest of 3 numbers using nested if else structure. 4
13.Describe else if Ladder with suitable examples.
14.Draw a flowchart to check whether the given number is odd or even. 4
Marks
15.In a programming language a Datatype refers to the type of data stored in
a memory location and the type of operations that can be performed on
those data. Discuss in detail various datatypes supported by C
programming language with examples.
16.Explain the basic structure of C program with an example. 7
17.Operators are used in programs to manipulate data and variables. Explain
in detail various built-in operators supported by C.
18.Tokens are smallest individual units of C program which can not be further
sub divided. Write about any three types of tokens available in C with
example. 4
19.Explain in detail the working of For Loop statement with syntax and
example
20.With syntax , explain the following structured constructs in C with example
i) simple “if” ii) do-while loop
21.Illustrate the following with example i) Arithmetic expression ii)
Relational expression iii) Logical expression 5
22.Write a C program to calculate the electricity consumption charge by
reading no of units of electricity consumption for first 200 units – 50
paise / unit from 201-400 units– 65 paise / unit from 401-600 units– 80
paise / unit Above 600 units– one rupee/ unit 5
Problem Solving Using C - B21DA0103

23.With syntax, explain the following structured constructs in C with


example i) “switch” case ii) “for” loop 5
24.List down and explain the differences between While and Do While loop
statements. 7 Marks
25.Write a menu driven program which has the following options. (i) To find
Factorial of a given number (ii) To find whether the given number is
prime or not.
26.Explain any three types of operators available in C with example 5Marks
27.With suitable example, illustrate the following
i) Operator precedence ii ) Associativity 5 Marks
28.Harish's basic salary is given as input through the keyboard. His dearness
allowance (DA) is 30% of basic salary; house rent allowance (HRA) is 20
% of basic salary. Write a program in C to calculate his gross salary.

You might also like