

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
I uploaded assignments for many different subjects related my degree Computer Science. This assignment for Programming in C and C plus plus Language includes: Programming, Print, Number, Header, Main, Function, Loop, Do, While, Macros, Array, Argument, Operation, Sorting, Pointer
Typology: Exercises
1 / 3
This page cannot be seen from the preview
Don't miss anything!


Course: Programming in C/C++ Language (3577) Semester: Spring, 2012 Level: PGD (CS) Total Marks: 100 Pass Marks: 40
(Units: 1–4)
Note: All questions are compulsory. Each question carries equal marks.
Q. 1 Explain the difference between the following: (a) Editor and the Compiler (b) Source program and the object program
Q. 2 (a) How can you use pseudo code and flow charts to solve different problems related to programming? Explain. (b) Explain the purpose and advantages of using comments in C/C++ Language.
Q. 3 (a) Write a simple program in C/C++ demonstrating the functions of relational operators. (b) Differentiate between syntax errors and logical errors.
Q. 4 (a) Differentiate between Input and Output in C/C++ language. Which libraries and keywords and required for Input and Output in a C/C++ program? (b) Write a simple program in C/C++ demonstrating the functions of assignment and logical operators.
Q. 5 (a) Write a program in C/C++ using nested if statement for calculating the average marks and grades of 5 subjects. (b) Write a program in C/C++ using switch statement for calculating the average marks and grades of 5 subjects.
(Units: 5–8) Total Marks: 100 Pass Marks: 40
Note: All questions carry equal marks.
Q. 1 (a) Write a program that prints the squares of all the numbers from 1 to 20. (b) What is the difference in execution sequence of the body of a do-while loop and a while loop? Explain with examples.
Q. 2 (a) What is the difference between break and continue statements? Explain with the help of suitable example. (b) For what purpose functions are used? Explain the structure of functions with the help of an example.
Q. 3 (a) What is a return statement? What are its limitations? (b) What are pre-processor directives? Explain the concept of header files. (c) What are the main differences between functions and macros? Explain.
Q. 4 (a) How single dimensional, two-dimensional, and three-dimensional arrays are initialized? How these arrays can be passed as arguments? Explain by using an example. (b) How sorting operation can be performed on arrays? Explain the sorting operation by using bubble sort.
Q. 5 (a) What is a pointer? Why are pointers used? What is an indirection operator? (b) How pointer variables are defined? How values are supplied to pointer variables? (c) Write a program using pointer notation to access individual elements of an array and print the sum and average of the elements of the array.
Recommended Book: The Wait Group’s Turbo C Programming for the PC and Turbo C++ by Robert Lafore
Reference Book: C++ Schaum outline series, Problem Solving and Program Design in C/6E by Hanly & Koffman
Course Outlines: Unit No. 1 Introduction to Computer Program Computer Program, Types of Languages (Low Level & High Level), Editor, Translator (Compiler & Interpreter), IDE, Source Program, Object Program