CONQUER C-Programming(1st SEM) EXAM targeted !!

  

Let's conquer C-Programming with this strategy!


Here is few notes and imp que targeted to this EXAM ! 
Have a look till last!

UNIT-1       PROBLEM SOLVING WITH COMPUTER 

Read Notes According to Syllabus: Problem analysis, Algorithms and Flowchart, Coding, Compilation and Execution, History of C, Structure of C program, Debugging, Testing and Documentation

Click me to view Notes of Unit 1

 

IMP QUESTIONS OF UNIT 1 

  1. Discuss structure of a C program with suitable example. [5 Marks] [2078] 
  2. Explain flowchart with example. What are the benefits of using flowcharts? [5 Marks] [2077] 
  3. Short notes on:  (a) History of C. [2.5 marks] [2078]  (b) Compilation and Execution. [2.5 Marks] [2077] 
  4. What do you mean by problem analysis? What are the properties of a good algorithm? Explain the compilation and execution of any C program. [1+1+3=5 Marks] [Model Set] 
  5. Write an algorithm and draw a flowchart to input a number and find out the factorial. [5 Marks] [1st term] 
  6. Write an algorithm and draw a flowchart to input a number and determine if the number is prime or composite. [5 Marks] [QT] 
  7. What is algorithm? How is it different from flowchart? [5 Marks]

 

 

 

UNIT-2      ELEMENTS OF C LANGUAGE 

 

Notes According to Syllabus: C Standards( ANSI C and C99), C Character Set, C Tokens, Escape sequence, Delimiters, Variables, Data types (Basic, Derived, and User Defined), Structure of a C program, Executing a C program, Constants/ Literals, Expressions, Statements and Comments. 

IMP QUESTIONS OF UNIT 2 

  1. Differentiate between constant and literals. Why do we need to define the type of data? [5 Marks] [2079] 
  2. What is variable? How is it different from constant? How do you write comments in C? [5 Marks] [2078] 
  3. What is data type? Why do we need it in programming? Explain any three basic data types with an example. [5 Marks] [2077] 
  4. What are data types in C? Explain in detail. [5 Marks] 

 

 

 

UNIT-3      INPUT AND OUTPUT 

Read Notes according to the Syllabus: Conversion specification, Reading a character, Writing a character, I/O operations, Formatted I/O 

 

IMP QUESTIONS OF UNIT 3 

  1. 1. Trace the output 

#include<conio.h> 

#include<stdio.h> 

void main(){ 

int i =0,k; 

for(k=5;k>=0;k–){ 

i=i+k; 

} 

printf(“%d\t”,i); 

getch(); 

} 

[5 Marks] [2080] 

  1. 2. Explain formatted I/O function in detail. [5 Marks] [2078] 

  1. 3. What do you mean by unformatted I/O ? Explain. [5 Marks] [2077] 

 

 

 

UNIT-4      OPERATORS AND EXPRESSION 

Read Notes according to the Syllabus: Arithmetic operator, Relational operator, Logical or Boolean operator, Assignment Operator, Ternary operator, Bitwise operator, Increment or Decrement operator, Conditional operator, Special Operators(sizeof and comma), Evaluation of Expression, Operator Precedence and Associativity. 

 

IMP QUESTIONS OF UNIT 4 

  1. List different types of operators and explain any three of them. [5 Marks] [2080] 
  2. What is preprocessor directives? Discuss # define directive with example. [5 Marks] [2075] 
  3. Discuss increment and decrement operators with example. [5 Marks] 
  4. What is type conversion? Discuss type casting with suitable example. [5 Marks] 
  5. Short note: a) Operator precedence & associativity. [2.5 Marks] [2077] 
  6. List various binary and unary operators used in C? Write a program that uses a “while” loop to compute and prints the sum of a given numbers of squares for e.g. if 4 is input, then the program will print 30, which is equal to 12+22+32+42. [1+4 = 5 Marks] [Model Set] 

 

 

UNIT-5      CONTROL STATEMENT [IMP FOR 10 MARKS] 

Read Notes According to the Syllabus: Conditional Statements, Decision Making and Branching, Decision Making and Looping, Exit function, Break and Continue. 

 

IMP QUESTIONS OF UNIT 5 [IMP FOR 10 MARKS] 

  1. Define structure and nested structure. Write a program to find out whether the nth term of the Fibonacci series is a prime number or not. Read the value of n from the user and display the result in the main function. Uses separate user-defined function to generate the nth Fibonacci term and to check whether that number is prime or not. [10 marks] [2080][Program part only] 
  2. Write a program to demonstrate the following menu-driven program. The user will provide an integer and alphabet for making choice and the corresponding task has to be performed according as follow: 

  • Find Odd or Even 
  • Find Positive or Negative 
  • Find the Factorial value 
  • Exit
The choice will be displayed until the user will give “D” as a choice. [10 marks] [2079]


 3. Why do we need a break and continue statement? Define formal argument and actual argument in function with examples. Identify and list the errors in the following code. 

int main(){ 
int a,b,c 
scanf("%d%d%d, &a, &b, &c); 
sum(a, b, c); 
return -1; 
} 
 
void sum(int x, int y, int z){ 
int sum; 
sum = a + b + c; 
return sum; 
} 
[10 marks] [2079] 
 
4.  What do you mean by jump statement? Explain each jump statement with example. Write a program to check whether a number entered is prime or not. [10 marks] [2078] 

5.  Write a program to check whether the entered word is pallindrome or not. [5 marks] [2080] 

6.  Write a program to read P*Q matrix of integers and find the largest integer of each row and display it. [5 marks] [2080] 

7.  How do you swap the values of two integers without using the third temporary variable? Justify with the example. [5 marks] [2079] 

8.  Write a program to print largest among three numbers entered by the user. [5 Marks] [2078] 

9. Write a program that computes the sum of digits of a given integer number. [5 Marks] 
 
 
 Pattern QUES: 

  1. 1. Write a program to print the following pattern: [5 Marks] 

1 

1 2 

1 2 3 

1 2 3 4 

1 2 3 4 5  

  1. 2. Write a program to print the following pattern: [5 Marks] 

1 

2 2 

3 3 3 

4 4 4 4 

5 5 5 5 5 

  1. 3. Write a program to print the following pattern: [5 Marks] 

* 

* * 

* * * 

* * * * 

* * * * * 

UNIT-6      ARRAYS [IMP FOR 10 MARKS] 

Read Notes According to the Syllabus: Introduction to Array, Types of Array (Single Dimensional and Multidimensional), Declaration and Memory Representation of Array, Initialization of array, Character Array and Strings, Reading and Writing Strings, Null Character, String Library Functions( string length, string copy, string concatenation, string compare) 

 

IMP QUESTIONS OF UNIT 6 [IMP FOR 10 MARKS] 

  1. Explain any three string functions. Write a program to check if two matrices are identical or act. [10 Marks] [2078] 
  2. What are the benefits of using arrays? Compare one dimensional array with two-dimensional array. Write a program to find transpose of a matrix. [10 Marks] [2077] 
  3. “Size of character array is always declared one more than input size.” Justify the statement. Write a program to read a character array input as “TRIBHUVAN UNIVERSITY” from the user and find out how many times a character ‘I’ occurs in that array? [1+4=5 Marks] [Model Set] 
  4. Write a program to initialize an array of dimension 10 and sort the numbers within the array in ascending order. [5 Marks] [2080] 
  5. Write a program to find the second largest number in the given array of numbers. [5 Marks] [2079] 
  6. Discuss any five string library functions. [5 Marks] [2075] 
  7. Write a program to find sum and average of 10 integer numbers stored in an array. [5 Marks] 
  8. Define array? What are the benefits of using array? Write a program to add two matrices using array. [5 marks] 
  9. Write syntax to declare and Initialize 2-dimensional array? With suitable program logic explain how would you find transpose of 3*3 matrix? [1+4=5 Marks] [Model Set] 
  10. Write a program for matrix addition and suppose the matrix size is 5x4. [5 Marks] [QT] 

 

 

UNIT-7      FUNCTIONS [IMP FOR 10 MARKS] 

Read Notes according to the Syllabus: Library Functions, User defined functions, Funciton prototype, Function call, and Function Definition, Nested and Recursive Function, Function Arguments and Return Types, Passing Arrays to Function, Passing Strings to Function, Passing Arguments by Value, Passing Arguments by Address, Scope visibility and lifetime of a variable, Local and Global Variable, 

 

IMP QUESTIONS OF UNIT 7 [IMP FOR 10 MARKS] 

  1. Define function and list it’s advantages. Describe the difference between passing arguments by value and passing arguments by address with suitable program. [4+6=10 Marks] [Model Set] 
  2. Explain the concept of recursive function using the example program to find the factorial of given positive integer. [5 Marks] [Model Set] 
  3. Write a program to compute the sum of first 10 even numbers using function. [5 Marks] [2080] 
  4. Write a program to calculate the factorial of a given number using recursion. [5 Marks] [2080] 
  5. Write a program to find the sum of digits of a given integer using recursion. [5 Marks] [2079] 
  6. Write a program using your own function to find sum of two numbers. [5 Marks] [2078] 
  7. Write a program to find product of two integers using your own function. [5 Marks] [2077] 
  8. What is function? Discuss the benefits of using function. [5 Marks] 

 

 

UNIT-8      STRUCTURE AND UNION [VERY IMP FOR 10 MARKS] 

Read Notes according to the Syllabus: Introduction, Array of structure, Passing structure to function, Passing array of structure to function, Structure within structure ( Nested Structure), Union, Pointer to structure 

 

IMP QUESTIONS OF UNIT 8 [VERY IMP FOR 10 MARKS] 

  1. Define structure and nested structure. Create a structure named Book with members Book_Name, Price and Author_Name, then take input for 10 records of Book and print the name of authors having the price of book greater than 1000. [10 Marks] [2080] 
  2. What is the difference between exit(0) and exit(1)? Discuss the need of nested structue with an example. Write a program to find the value of xy without using POW code. [10 Marks] [2079] 
  3. Define structure. Explain nested structure with example. Create a structure named book with name, author, and publisher as its members. Write a program using this structure to read data of 50 books and display name of those books published by “XYX” publisher. [10 Marks] [2078] 
  4. What is structure? How is it different from union? Create a structure named course with name, code, and credit_hour as its members. Write a program using this structure to read data of 5courses and display data of those courses with credit_hour greater than 3. [10 Marks] [2077] 
  5. Explain how structure is different from union? Make a program using structure of booklist having data member’s title, author, and cost. Enter four data amd calculate total cost. [3+4+3=10 Marks] [Model Set] 
  6. Define structure. Write a program to read 100 students' data like as student id, student name and student address using structure and sort all these records in ascending order based on name. [10 Marks] [QT] 
  7. What is structure? How is it different from array? Create a structure student having data members name, roll-number and percentage. Complete the program to display the name of student having percentage greater than or equal to 60. [10 Marks] 
  8. What is the advantage of the union over structure? List any four-string library functions with the prototype. [5 Marls] [2079] 
  9. Create a structure “Employee” having Name, Address, Salary, and Age as member functions. Display the name of the employee having aged between 40 and 50 are living in Kathmandu. [5 Marks] [2079] 
  10. What is structure? Create a structure rectangle with data members length and breadth. [5 Marks] [2075] 

 

 

UNIT-9      POINTERS [10 MARKS] 

Read Notes according to the Syllabus: Introduction, The & and * operator, Declaration of pointer, Chain of Pointers, Pointer Arithmetic, Pointers and Arrays, Pointers and Character Strings, Array of Pointers, Pointers as Function Arguments, Function Returning pointers, Pointers and Structures, Dynamic Memory Allocation 

 

IMP QUESTIONS OF UNIT 9 [10 MARKS] 

  1. Explain the relation to array and pointer. Differentiate call by value and call by reference with a suitable program. [10 Marks] [2080] [1st part only] 
  2. What is dynamic memory allocation? Explain with a suitable program. [5 Marks] [2080] 
  3. List any one advantage and disadvantage of the pointer. How do you pass pointers as function arguments? [5 Marks] [2079] 
  4. Explain dynamic memory allocation with example [5 Marks] [2078] 
  5. Define pointer. How do you return pointers from functions? Explain with an example. [5 Marks] [2077] 
  6. What is dynamic memory allocation? Discuss the use of malloc() in dynamic memory allocation with example. [5 Marks] [2075] 
  7. Describe the fundamental concept of pointer and it’s arithmetic with suitable examples. [5 Marks] [Model Set] 
  8. What is pointer? Write a program to input N numbers and sort them in ascending order and display. Do it by using DMA(Dynamic Memory Allocation). [5 Marks] [QT] 
  9. Define pointer. Discuss the relationship between pointer and one-dimensional array. [5 Marks] 
  10. Write short note on: a) Dynamic Memory Allocation. [2 Marks] [Model Set] 

 

 

 

UNIT-10      FILE HANDLING IN C [10 MARKS] 

Read Notes according to the Syllabus: Concept of File, Opening and closing of File, Input Output Operations in File, Random access in File, Error Handling in Files 

 

IMP QUESTIONS OF UNIT 10 [IMP FOR 10 MARKS] 

  1. Explain various modes in which file can be opened? Write a program to CREATE and WRITE N numbers in a file “NUMBER.TXT”, Open this file then read its content and pull all even numbers in one file “EVEN.TXT” and odd numbers in another file “ODD.TXT”. [2+4+4=10 Marks] [Model Set] 
  2. Why do we need data files? What are the different file opening modes? Write a program that reads data from a file “input.txt” and writes to “output.txt” file. [10 Marks] [2075] 
  3. What do you mean by FILE pointer? Explain the file open modes and give an example for storing data into the file. [10 Marks] [QT] 
  4. Write a program to read 20’s parts information like as part_Id, Part_Name, Part_Description and Quantity from the keyword and store into a file called “parts.dat” and read the contents from the same file and display those parts information whose Quantity is more than 100. [10 Marks] [QT] 
  5. Describe the different types of I/O functions used in file handling with syntax. [5 Marks] [2080] 
  6. Suppose a file named “Num.txt” contains a list of integers. Write a program to extract the prime numbers only from that file and write them on “Prime.txt” file. [5 Marks] [2079] 
  7. Write a program that simply reads data from a file [5 Marks] [2078] 
  8. Write a program to read and print data stored in a file input.txt. [5 Marks] 
  9. Explain different file I/O functions with example. [5 Marks] [2077] 

 

UNIT-11      INTRODUCTION TO GRAPHICS 

Read Notes according to the Syllabus: Concepts of Graphics, Graphics Initialization and Modes, Graphics Function 

 

Create graphics program that address some basic functions of graphics.h header file, e.g. line(), arc(), circle(), ellipse(), floodfill(), getmaxx(), getmaxy() etc. 

 

IMP QUESTIONS OF UNIT 11 

  1. Explain the use of graphical functions. Write a program to draw a triangle using line() graphics function. [1+4=5 Marks] [Model Set} 
  2. Write a program to display two centric circle and inside there display “BSC 1st Sem”. [5 Marks] [QT] 
  3. Write a program to draw a line using graphics function. [5 Marks] [2078] 
  4. Write short notes on: a) Graphics functions [2.5 Marks] [2075] 
  5. Write a program to draw a circle using graphics function [5 Marks] [2077] 
  6. Why do we need graphics functions? Write a program to draw a circle. [5 Marks] 

 

IMP      SHORT NOTES 

  1. Local, Global and Static Variables 
  2. Conditional Operator 
  3. History of C 
  4. Bitwise Operator 
  5. Compilation and Execution 
  6. Operators Precedence and Associativity 
  7. Benefits of Data files 
  8. Graphics Function 


These were the all the previously asked questions chapterwise with few notes.
 ******

May Devine Goddess protect you all ! Keep faith and hardwork..

! "GOOD LUCK" !


No need to thank, but you can definitely help UJJU_Rizz-ALL by listening this vid full:


Name: Ujjwal Rijal  

Address: Earth

Instagram: www.instagram.com/rijalujjwal87

Twitter: www.x.com/ujjwalreezal

Facebook: www.facebook.com/UjjuGod

Youtube : www.youtube.com/@fyaste


 

 

Comments

Popular posts from this blog

Complete Numerical Methods Course

CSIT 3rd DSA Study Guide with Soln

STAT-II GUIDE FOR BOARD AND QT BY UJJU