0% found this document useful (0 votes)
76 views7 pages

C Question Bank Unit1&2

The document is a question bank for a course on Problem Solving Using C, covering Units I and II. It includes a variety of questions categorized into 2-mark, 5-mark, and 10-mark questions, addressing topics such as algorithms, flowcharts, data types, operators, control statements, and C programming concepts. The questions range from definitions and explanations to programming tasks and algorithm writing.

Uploaded by

Alisha Anwer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views7 pages

C Question Bank Unit1&2

The document is a question bank for a course on Problem Solving Using C, covering Units I and II. It includes a variety of questions categorized into 2-mark, 5-mark, and 10-mark questions, addressing topics such as algorithms, flowcharts, data types, operators, control statements, and C programming concepts. The questions range from definitions and explanations to programming tasks and algorithm writing.

Uploaded by

Alisha Anwer
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

PROBLEM SOLVING USING C- B21DA0103

QUESTION BANK -UNIT I & II

2 Mark Questions:

1.Write difference between algorithm and flowchart.


2. Explain the importance of C language.
3. What is format specifier?
4. Define keyword, constant and variable.
5. Write a short note on type casting.
6. Explain sizeof() with example?
7. Why do we use header files?
8. Define relational operator?
9. What is the purpose of adding comments in a program?
10. Differentiate between computer software and hardware
11. a) Find errors if any in the following
1. int a;
2. float VALUE
3. exponent alpha
4. char=p,q;
5. short charm;
6. long int x; counter;
7. long float fact
12. What is software? Mention the classification of software.
13. Mention the different datatypes supported in C language.
14. What is typecasting? Give an example.
15. Mention the classifications of I/O functions with example.
16. Explain the break and continue statements.
17. Give the advantages of functions.
18. What is preprocessor directive? Give an example.
19. What is ternary operator?
20. What are the rules for declaring a variable in C?
21. What are the local and global variables?
22. What are the uses of break and continue statements?
23. What is a storage class?
24. What is structured programming?
25. Define the different types of type conversion with example.
26. What is enumerated data type?
27. Why is ‘C’ called a middle level language? Justify.
28. What is subroutines?
29. What is the difference between character constants and string constants
30. What is trigraph characters?
31. What is typedef?
32. What is expressions?

5 Mark Questions

1. What is the purpose of scanf() and printf() function?


2. Discuss the structure of C program?
3. Discuss about formatted input.
4. Briefly discuss about if….else statement/
5. Write a C program to find smallest among N numbers.
6. Write the scope and lifetime of a variable.
7. Write a program to find the factorial of a number
8. Explain different storage classes in c with syntax and example.
9. Discuss different types of looping statements with the example.
10. Compute the following expression
1. x= (-5*2/(6+4-2)+(2/3+5)
2. y=5-8/2+9*4+8/4-7+1
11. Describe the nested if -else statement with example.
12.Difference between if and switch with example
13.Role of flowcharts in graphical representation of a solution to a problem
14.Define (i) Keywords (ii) basic data types (iii) constants and literals.
15.Explain switch case with real life example.
16.Distinguish between while and do-while
17.Explain type conversion with suitable example.
18.Write a C program to calculate simple and compound interest.
19.How to read and write a character?
20.Explain if else statement with an example.
21.What are the mathematical functions in C? Explain
22.Elaborate the concept of identifier and the rules to be followed for forming
an identifier.
23.Write a note on GOTO statement with example.
24.How will you writing a character in C? Give an example.
25.Write down the reading strings from terminal in C with example.
26.How will you declare and initialize string variable ? explain
27.Elaborate the need for user defined fucntions.
28.Describe the no argument and no return values to function in C.
29. Elaborate For.Loop statement in detail. Also implement
30.Write the algorithm to find the sum of series: 1+2+3+4+…..upto n terms.
31.Write a C program to print the following format.
1
12
123
1234
32.Write an algorithm to find average of three numbers.
33.Write a C program to find factorial of a number.
34.Write a note on formatted I/O functions in C.
35.Explain various IF statements.
36. Explain call by value and call by reference.?
37.Write a note on local and global variables.?
38. Write a C program to check whether the given year is LEAP year or not.
39. Explain the rules of symbolic constants

10 Mark Questions

1. Explain gets() and puts() function


2. Explain structure of a C program with the suitable example.
3. Discuss the function and its concepts.
4. Discuss about nested if loop with example.
5. What is flowchart? Explain different symbols used for flowchart.
6. What is constant? Explain different constants in C.
7. What is variable? Give the rules for variable declaration.
8. Write an algorithm and flowchart to generate Fibonacci series of
numbers up to 'n'.
9. Draw the flowchart to find the greatest of three numbers.
10. Write an algorithm and flowchart to find whether the given number is
prime or not.
11. Write the structure of C program and explain.
12. Explain about type conversion in C.
13. Draw the flowchart to find the greatest of three numbers.
14. Discuss about the following operators in C language with example.
a. Bitwise operators
b. Increment and decrement operators
c. Logical operators
15. a) Explain the program structure of C with suitable example.
c) A token is a smallest individual unit of q program. Justify your answer.
Explain in detail various tokens in C with the help of example each.
16.a) Define Flowchart. Explain the various notation of flowchart with the
help of example to find greatest of 2 numbers
17.Write a program to find
1. Factorial of number
2. Reverse of an integer.
18.Write briefly about different types of operators. Write a program for
simple calculator using arithmetic operator.
19.Explain different types of selection statement with example.
20.Demonstrate the usage of a switch statement with an example.
21. Explain data types in C
22. Significance of looping and its types.
23.Compare (i) for and do-while loop (ii) while and For
24.Explain with illustration the nested control structures.
25.Write a C program to check whether the given number is Armstrong or
not.
26.Explain operator precedence and associative.
27.Describe conditional operator and goto statement.
28.Explain for loop with example program.
29.What is a variable in C language? How will you declare and initialize a
variable.
30.Write about arithmetic operators in C.
31.Explain unary and ternary operators with an example.
32. Explain bitwise operator used in C language.
33.Determine the assigning values if variables with example.
34.Illustrate the ELSE IF Ladders with example.
35.Explain Top down design in C Language?
Question Bank
Unit 1

1.Define the following: a) Algorithm b) Flowchart


2. What is an algorithm? Write an algorithm to swap two numbers using
temporary variable.
3.List out the basic categories of Data types and explain each one of
them.
4.Write a C program to convert temperature in Fahrenheit to Celsius
using the formula C= (F-32) / 1.8.
5. What is variable? Give the rules for variable declaration.
6. What is Variable? Discuss briefly various rules to be followed while
constructing variables.
7.Write an algorithm and flowchart to generate Fibonacci series of
numbers up to 'n'.
8. What is flowchart? Explain different symbols used for flowchart.
9. Write an Algorithm and C Program to find the area of Triangle.
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.
11. Define: Data types. Describe the various built in data types available
in C along with datatype modifiers.
12.Explain briefly the structure of C Program.
13. Explain Briefly about five operators of C with an example.
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
16. Write the structure of C program and explain.
17. Define algorithm. Write algorithm for finding factorial of a number
18. What is flowchart? Explain different symbols used for flowchart.
19. What is constant? Explain different constants in C.
20. Define flowchart. Explain various notations used to draw a flowchart.
21. Draw the flowchart to find the greatest of three numbers.
22. Write an algorithm and flowchart to find whether the given number is
prime or not.
23.What is an algorithm? Write an algorithm to add two numbers and
display the result.
24.Explain the basic structure of C program with an example.
25. Evaluate the expression i)5-8/2+9*4+8/4-7+1 4 ii)(-5*2/(6+4-
2)+(2/3+5)
26. Evaluate the expression 2*((8%5) *(4+(15-3)/(4+2)))
27.Evaluate the expression 100/20<=10-5+100%10-20==5>=1! =20
28. Evaluate the expression a+2>b&&! c\\a! =d&&a-2<=e
29. A token is a smallest unit of a program. Justify your answer. Explain
in detail various tokens in c with the help of example.
30.Write a program to find factorial of a number and reverse of an
integer.
31. What are tokens? Explain the various types of tokens. What are the
identifiers forming rules?
Unit 2

1. Discuss the types of Looping Statement with help of example.


2. Explain increment and decrement operators in C with examples.
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.
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.
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.
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.
13.Describe else if Ladder with suitable examples.
14.Draw a flowchart to check whether the given number is odd or even.
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.
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.
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
22. Write a C program to check whether the given number is prime or not

You might also like