Programming in C and C plus plus Language-Computer Science-Assignment, Exercises of Programming Languages

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

2011/2012

Uploaded on 08/25/2012

jonny2
jonny2 🇮🇳

4.3

(18)

53 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
(Department of Computer Science)
WARNING
1. PLAGIARISM OR HIRING OF GHOST WRITER(S) FOR SOLVING
THE ASSIGNMENT(S) WILL DEBAR THE STUDENT FROM AWARD
OF DEGREE/CERTIFICATE, IF FOUND AT ANY STAGE.
2. SUBMITTING ASSIGNMENTS BORROWED OR STOLEN FROM
OTHER(S) AS ONE’S OWN WILL BE PENALIZED AS DEFINED IN
Course: Programming in C/C++ Language (3577) Semester: Spring, 2012
Level: PGD (CS) Total Marks: 100
Pass Marks: 40
ASSIGNMENT No. 1
(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.
docsity.com
pf3

Partial preview of the text

Download Programming in C and C plus plus Language-Computer Science-Assignment and more Exercises Programming Languages in PDF only on Docsity!

(Department of Computer Science)

WARNING

1. PLAGIARISM OR HIRING OF GHOST WRITER(S) FOR SOLVING

THE ASSIGNMENT(S) WILL DEBAR THE STUDENT FROM AWARD

OF DEGREE/CERTIFICATE, IF FOUND AT ANY STAGE.

2. SUBMITTING ASSIGNMENTS BORROWED OR STOLEN FROM

OTHER(S) AS ONE’S OWN WILL BE PENALIZED AS DEFINED IN

Course: Programming in C/C++ Language (3577) Semester: Spring, 2012 Level: PGD (CS) Total Marks: 100 Pass Marks: 40

ASSIGNMENT No. 1

(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.

ASSIGNMENT No. 2

(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.

Programming in C/C++ Language (3577) Credit Hours: 4(3 + 1)

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