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

MCA TermEndPracticalExam Set2

Uploaded by

priya
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)
68 views3 pages

MCA TermEndPracticalExam Set2

Uploaded by

priya
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
You are on page 1/ 3

Directorate of Online Education

Manipal University Jaipur


Term Practical Examination 2021

Program: MCA
Subject: Programming in C – Practical
Course Code:
Set No: 2
Maximum Marks: 30
Prepared by: Dr Priyanka Mathur

PRACTICAL EXAM INSTRUCTIONS -

1. The External practical examination contains 2 questions.


2. Appropriate marks will be awarded for each correct step.
3. All questions need to be attempted.

Problem 1

Exercise Objective: To check the understanding of the learner regarding correct


application of looping constraints.

Problem Statement 1: Write a C program to input number from user and find sum of
all even numbers between 1 to n.

Instructions:

 Write proper comment to make your code readable.


 Use proper naming convention for variables etc in your code.
 Ensure your code compiles without any errors/warning/deprecations
 Avoid too many & unnecessary usage of white spaces (newline, spaces, tabs, …)
 Always test the code thoroughly, before saving/submitting exercises/project.

Expected Output: Print the sum of all even numbers between 1 to n.

Test cases:

Sample Input Sample Output


Input upper limit of even number: 10 Sum of even numbers between 1 to 10: 30
Input upper limit of even number: 20 Sum of even numbers between 1 to 20: 60

Problem 2

Exercise Objective: To check the correct usage of pointers.

Problem Statement 2: Write a program in C to find the maximum number between two
numbers using a pointer.

Instructions:

 Write proper comment to make your code readable.


 Use proper naming convention for variables etc in your code.
 Ensure your code compiles without any errors/warning/deprecations
 Avoid too many & unnecessary usage of white spaces (newline, spaces, tabs, …)
 Always test the code thoroughly, before saving/submitting exercises/project.

Expected Output: The learner should be able to compare two values and print the
greater amongst them using pointers.

Test cases:

Sample Input Sample Output


Input the first number : 5 6 is the maximum number
Input the second number : 6
Viva Questions

Q1. Why is C known as a mother language?

Q2. What are the 3 parameters that are necessarily given for correct execution of a while loop?

Q3. What is the difference between while and do-while loop?

Q4. What is the usage of the pointer in C?

Q5. What is a VOID pointer?

Q6. What is the difference between the local variable and global variable in C?

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy