0% found this document useful (0 votes)
11 views3 pages

C Programming Problem Solving Guide

The document outlines an assignment on programming for problem-solving, focusing on C programming concepts. It includes detailed tasks on computer hardware and software, C data types, algorithms, flowcharts, control statements, arrays, functions, pointers, and string handling. Each section contains specific programming exercises and theoretical questions to enhance understanding of C programming.

Uploaded by

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

C Programming Problem Solving Guide

The document outlines an assignment on programming for problem-solving, focusing on C programming concepts. It includes detailed tasks on computer hardware and software, C data types, algorithms, flowcharts, control statements, arrays, functions, pointers, and string handling. Each section contains specific programming exercises and theoretical questions to enhance understanding of C programming.

Uploaded by

SIDDHARTH SINGH
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Assignment

PROGRAMMING FOR PROBLEM SOLVING

OVERVIEW OF COMPUTERS AND C-PROGRAMMING

1. Describe in detail about computer hardware and software.

2. Write detailed notes on C data types.

3. Write an algorithm, flowchart and C program to find the sum of numbers from 1 to ‗n‘

4. Discuss about the following operators in C language with example.

a. Bitwise operators
b. Increment and decrement operators c. Logical operators
5. Perform the following operations
a. 23>>3 b. 27<<2 c. 15&9 d. 15^9 e. 15 | 9

6. Write the structure of C program and explain.

7. (a) Define algorithm. Write algorithm for finding factorial of a number.


(b) What is flowchart? Explain different symbols used for flowchart.

8.(a) What is constant? Explain different constants in C.


(b) What is variable? Give the rules for variable declaration.
9. (a) Write an algorithm and flowchart to generate Fibonacci series of numbers up to 'n'.
(b) Draw the flowchart to find the greatest of three numbers.
10. (a) Write an algorithm and flowchart to find whether the given number is prime or not.
(b) Explain about type conversion in C.

DECISION & LOOP CONTROL STATEMENTS

1. Explain various branching statements in C with examples.

2. (a) Write and explain about switch statement.


(b) Write a Program to perform arithmetic operations using switch.
3. List and explain loop control (or) iteration statements in C.

4. (a) Write and explain syntax of ―for‖ loop.

(b) Write a program to generate prime numbers between 1 and ‗n‘.

5. (a) Write a program to check whether the given number is palindrome or not.

(b) Write a program to check whether the given number is ―Even‖ or ―Odd‖ using GOTO

statement.

6. List and explain unconditional statements in C with examples.

7. (a) Write a program to find sum of the individual digits of a given number.

(b) Write a program to find the sum of even and odd numbers from 1 to n.

8. (a) Write a program to find the factorial of a given number.


(b) Write a program to generate ‗n‘ Fibonacci numbers.
9. (a) What is a nested loop? Write a program to display multiplications tables from 1 to n. (b) Write a program
to display the following pattern.
*****
****
***
**
*
10. (a) Explain else-if ladder with the help of flowchart and program.
(b) How does nested if-else works explain with an example?

Arrays and Functions

1. (a) Define an array. How to initialize one-dimensional array? Explain with suitable examples.

(b) Write a C program to sort the given array elements in Ascending order.

[Link] to declare and initialize a Two-dimensional array? Discuss with examples.

3. Write a C program to multiply two matrices of different order.


4. (a) Write a C program to read and display a 3 by 3 matrix.
(b) Write a C program to add 2 matrices of size n by n.

5. (a) Illustrate multidimensional arrays with example program.


(b) Write a C program to find the largest element given in an array of elements.
6.(a) What are the advantages of functions?
(b) Write a C program using function to exchange two numbers using pointers.
7. (a) Discuss about the different categories of functions.
(b) Write a C program to illustrate call-by-value parameter passing technique.
8. (a) Write short notes on nested functions.
(b) Write a C program to explain call-by-reference parameter passing technique.
9. (a) What is recursion? What are the advantages and Disadvantages of recursion?
(b) Write a C program to find the factorial of a given number using recursion.
10. Distinguish between the following:
a. Actual and formal arguments b. Global and local variables

POINTERS AND STRINGS

1. (a) Define pointer. How to declare and initialize it.


(b) Write a C program to illustrate the use of indirection operator to access the value
pointed by a pointer.

2. (a) What are the features of pointers? Write a C program to print address of a variable

(b) Explain the declaration of pointers with examples.


3. (a) With proper examples explain different arithmetic operations on pointers.
(b) Write a C program to show that pointer of any data type occupies same space.
4. (a) Explain the concept of functions returning pointers with example.
(b) Write a C program to read and print an array of elements using pointers.
5. (a) Explain the concept of array of pointers with examples.
(b) Write a C program to read and display multiple strings using pointers.
6. (a) Write a C program to count the number of vowels, consonants, digits, spaces and special characters in a
given string.
(b) Write a C program to read the elements in an array and print the same in reverse order.

7. (a) Write a C program to implement strcmp() , strcat() , strcpy() and strlen().


(b) Write a program to find the average marks obtained by a class of 50 students in a test.
8. (a) Explain declaration and initialization of array of strings.
(b) Write a C program to find whether a given string is palindrome or not.
9. (a) Discus about arithmetic operations on characters.
(b) Write a C program to read a set of strings and sort them in alphabetical order.
10. Explain the following string handling functions with example:
a. strcpy() b. strcmp() c. strcat() [Link]() e. strncat()

You might also like