PWC_question bank

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

PROGRAMMING WITH C | Question bank

Unit 1 part 1: Introduction to computer and programming (9 marks)


1. Differentiate software and hardware. (2 Marks)
2. Define: i) Linker ii) Operating System (2 Marks)
3. Differentiate compiler and interpreter. (2 Marks)
4. Explain assembler (2 marks)
5. Explain compiler (2 marks)
6. What are the functions of linker and loader? (2 Marks)
7. Draw a problem development life cycle (2 marks)
8. Define algorithm. Enlist any 2 characteristics of algorithm. (2 Marks)
9. Write an algorithm to find whether the given number is odd or even. (2 Marks)
10. Write an algorithm to calculate cube of given number. (2 Marks)
11. Write an algorithm to calculate simple interest using the expression (SI = PNR/100). (2
Marks)
12. Enlist various types of programming languages and explain one of them. (2 Marks)
13. Draw different symbols used in flowchart. (2 Marks)
14. Draw a flowchart for find area of square. (flowchart will be random) (2 marks)
15. Convert (110101)2 to its decimal equivalent (number will be random) (2 Marks)
16. Convert (254)10 to its binary equivalent. (number will be random) (2 Marks)
17. What is programming language? Explain low-level and high-level language with its
advantages and disadvantages. (5 Marks)
18. Enlist various types of programming languages. Explain any one with its advantages and
disadvantages. (5 Marks)
19. What is flowchart? Draw a flowchart to do the sum of 10 elements read from user. (5 Marks)
20. Enlist various symbols used in flowchart. Draw a flowchart to find the sum of all even
numbers up to ‘n’. (5 Marks)
21. Draw a flowchart and write an algorithm to generate Fibonacci series up to given term. (5
Marks)
22. Write an algorithm and draw a flowchart to Find the sum of first five natural numbers. ( 5
marks)
23. Draw a flowchart to find factorial of given number. (5 Marks)
24. Write an algorithm and/or draw a flowchart to Interchange the value of two numbers (using
3rd variable). (2 marks)
25. Write an algorithm and/or draw a flowchart to Interchange the value of two numbers (without
using 3rd variable). (2 marks)
26. Write an algorithm and/or draw a flowchart to find the largest from two numbers (2 marks)
27. Flowchart to find maximum number from three different numbers. (5 marks)
28. Flowchart to reverse given number. (5 Marks)
Unit 1 part 2: variable and expressions
1. Write down any two features of C (2 Marks)
2. What is C token? Enlist C tokens. (2 Marks)
3. Write down the rules for Identifier. (2 Marks)
4. Explain conditional operator with an example. (2 Marks)
5. Enlist primary datatype in C and explain anyone. (2 Marks)
6. What is constant? Enlist types of constants in C. (2 Marks)
7. Describe symbolic constant. How symbolic constant can be defined in C program? (2 Marks)
8. Explain basic structure of C program in detail. (5 Marks)
9. Enlist types of operators in C and explain any two operators with an example. (5 Marks)
10. Enlist and explain type casting with an example. (5 Marks)
Note* algorithm and flowchart can be random but related

Rasi patel
PROGRAMMING WITH C | Question bank

Unit 2: Basic input output and Control structure (14 marks) (4+5+5)
1. What will be the output of the following C code? (code might be random) (2 Marks)
#include <stdio.h>
void main()
{
int x = 5;
int y = x++ + 10;
printf("%d,%d",x,y);
}
2. What will be the output of the following C code? (2 Marks)
#include <stdio.h>
void main()
{
int a,b,c,d;
a=12;
b=21;
c= a++ +10;
d= --c;
printf("%d,%d",c,d);
}
3. What will be the output of the following C code? (2 Marks)
#include <stdio.h>
void main()
{
int x = 10;
if(x=5)
{
printf("In If block");
}
printf("End program");
}
4. Write down syntax for do..while loop and also draw the flowchart for it. (2 Marks)
5. Differentiate nested if-else and else-if ladder with proper example. (5 Marks)

Rasi patel
PROGRAMMING WITH C | Question bank

6. Write down Syntax of switch case and explain it with an example. (5 Marks)
7. Explain for loop with its syntax, flow chart and example. (5 Marks)
8. Explain while loop with its syntax, flow chart and example. (5 Marks)
9. Differentiate entry-controlled loop and exit-controlled loop with an example. (5 Marks)
10. Write a program to find smallest number among three numbers using nested if...else
statement. (5 Marks)
11. Write a C program to create basic calculator using switch case. (5 Marks)
12. Write a program to reverse a given integer number. (5 Marks)
13. Write a program to check the given number is Armstrong number or not. (5 Marks)
14. Write a program to print first N Fibonacci numbers. (5 marks)
15. Write a program to reverse a given integer number and also check for palindrome. (5 marks).
16. Write a program to print the following pattern using loop. (5 Marks)
****
***
**
*
17. Write a program to print the following pattern using loop. (5 Marks)
AAAAA
BBBB
CCC
DD
E
18. Write a program to print the following pattern.
*
**
***
****
*****
19. Write a program to read marks from keyboard and display equivalent grade according to
following data: (5 Marks)
Marks Grade
100 - 80 Distinction
79 - 60 First Class
59 - 40 Second Class
< 40 Fail
20. Write a program to print the following pattern using loop. (5 Marks)
1
22
333
4444
55555

Rasi patel
PROGRAMMING WITH C | Question bank

21. Write a program to print the following pattern. (5 Marks)


11111
3333
555
77
9

Unit 3: Arrays (7 marks) (2+5)


1. Define an array. How does it differ from a simple variable? (2 Marks)
2. How would you declare a one-dimensional array of integers with 5 elements in C? (2 Marks)
3. Write the syntax to declare and initialize a two-dimensional array with 2 rows and 3 columns
in C. (2 Marks)
4. Write a code to initialize a 2x2 matrix in C (take value from user) (2 Marks).
5. What is the identity matrix? Provide an example using a 2D array (2 Marks).
6. How would you declare a 3D array in C? Give an example. (2 Marks)
7. What are multi-dimensional arrays used for in real-world applications (2 Marks)
8. Explain the advantages of using arrays in programming. Provide an example where an array is
more efficient than individual variables. ( 5 Marks)
9. Write a program in C to declare, initialize, and print the elements of a one-dimensional
integer array with 5 elements. (5 Marks)
10. Write a program in C to declare, initialize, and print the elements of a two-dimensional
integer array with 5 elements. (5 Marks)
11. Write a C program to add two 2x2 matrices and display the result. (5 Marks)

12. Write a program to find out the Maximum and Minimum number from given 10 numbers. (5
Marks)
13. Write a program to get n numbers and find sum and average of numbers. (5 Marks)

14. Write a program to find number of odd and even numbers from given n numbers. (5 Marks)

15. Write a program to sort given n numbers and display them in ascending and descending order.

16. Write a program to perform addition of two 3x3 matrices. (5 Marks)

17. Write a program to find transpose of any 3x3 matrix. (5 Marks)

18. Write a program to perform multiplication of two 3x3 matrices. (5 Marks)

Rasi patel

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy