0% found this document useful (0 votes)
24 views1 page

C Programming Practical Assignments

The document contains a list of 12 practical programming assignments for a C programming course. It includes writing programs to find the area and perimeter of a square, determining the smallest of three numbers, demonstrating variable types, arithmetic operators, and determining if a number is even or odd. Further assignments involve finding the maximum/minimum of three numbers or in an array, reversing strings, checking for prime numbers with functions, calculating factorials with functions, swapping elements using call by reference, and counting vowels and consonants in a string using pointers. It also provides 5 recommended C programming textbooks and reference books.
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)
24 views1 page

C Programming Practical Assignments

The document contains a list of 12 practical programming assignments for a C programming course. It includes writing programs to find the area and perimeter of a square, determining the smallest of three numbers, demonstrating variable types, arithmetic operators, and determining if a number is even or odd. Further assignments involve finding the maximum/minimum of three numbers or in an array, reversing strings, checking for prime numbers with functions, calculating factorials with functions, swapping elements using call by reference, and counting vowels and consonants in a string using pointers. It also provides 5 recommended C programming textbooks and reference books.
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

DEPARTMENT OF

COMPUTER ENGINEERING

Course Code: UESC203 Subject: C - Programming

List of Practical Assignment

1. Write Algorithm & Flowchart to find Area and Perimeter of Square.

2. Write Algorithm & Flowchart to find smallest number among three numbers.

3. Write a program to demonstrate all types of variables.

4. Write a program to demonstrate Arithmetic operators in C language.

5. Write a c program to find whether number is even or odd.

6. Write a c program to find minimum/maximum number from three given numbers.

7. Write a c program to find maximum/maximum number from array.

8. Write a c program to reverse given string.

9. Write a c program to find whether given number is prime no. or not, using function.

10. Write a c program to calculate factorial of given number using function and pass number as
parameter.

11. Write a c program to swap elements using call by reference.

12. Write a c program to count vowels and consonants in a string using Pointer

Textbooks:
1 “A Computer Science –Structure Programming Approaches using C”, by Behrouz Forouzan, Cengage Learning.
2 Schaum’s outlines “Programming with C”, by Byron S. Gottfried, Tata McGraw-Hill Publications.
Reference Books:
1 “Basics of Computer Science”, by Behrouz Forouzan , Cengage Learning.
2 “Programming Techniques through C”, by M. G. Venkatesh Murthy, Pearson Publication.
3 “Programming in ANSI C”, by E. Balaguruswamy, Tata McGraw-Hill Education.
4 “Programming in C”, by Pradeep Day and Manas Gosh, Oxford University Press.
5 “Let Us C”, by Yashwant Kanetkar, BPB Publication

Common questions

Powered by AI

Textbooks provide theoretical insights and structured learning paths, illustrating fundamental concepts with practical examples. 'A Computer Science – Structure Programming Approaches using C' offers comprehensive explanations of programming paradigms and problem-solving techniques, enhancing understanding and application of concepts covered in assignments .

Using functions compartmentalizes code, enhancing readability and reusability. Implementing prime checking logic within a function allows repeated use without rewriting, improving maintainability. It also isolates logic, facilitating easier debugging and updates, and allows testing and optimization of that specific function separately from the main program .

Functions encapsulate specific tasks, improving code readability by clearly separating logic into modular segments. This modularity enhances debugging and maintenance while promoting code reuse. For calculating factorials, a function can recursively call itself or iteratively compute the result, reducing redundancy and enhancing organization .

Understanding arithmetic operators is fundamental for performing basic calculations and logical operations in programming. Demonstrating their use helps grasp data manipulation concepts, enhancing problem-solving capabilities, and providing a basis for more complex operations such as bit manipulation and mathematical algorithms .

Using pointers in C allows for efficient manipulation of data by directly accessing memory addresses. This reduces execution time and memory usage compared to using array indices. Additionally, pointers can simplify some operations, such as traversing strings, by incrementing the pointer itself rather than calculating an index for each access .

'Call by reference' allows functions to modify the original variable rather than working on a copy. This is particularly useful in swapping elements, as it enables direct swapping of the contents in memory without the overhead of copying variables, leading to more efficient memory usage and processing speed .

Reversing a string in C requires understanding of concepts such as arrays for storing characters, loops for iterating over elements, and temporary variables for swapping characters. Knowledge of null-terminated strings and pointers is also essential for efficient manipulation and memory management .

Challenges include handling different array sizes and types, ensuring efficient iteration through the array, and managing edge cases like empty arrays or all similar elements. These can be addressed by implementing checks for array bounds, using loops optimally, and incorporating error handling mechanisms to manage exceptional cases smartly .

Algorithms provide a step-by-step approach to solving problems, making it easier to understand the flow of logic needed to calculate the area and perimeter of a square. Flowcharts visually represent these steps, helping to organize thoughts and identify potential errors before coding .

Selecting the proper algorithm affects a program's efficiency in terms of time and space complexity. Efficient algorithms reduce processing time and resource usage, which is crucial for sorting and searching operations. Correctly designed flowcharts contribute to visualizing complex logic, ensuring implementation correctness, and optimizing performance .

You might also like