0% found this document useful (0 votes)
21 views

C Unit 1 Assignment

Uploaded by

ankitaluke
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)
21 views

C Unit 1 Assignment

Uploaded by

ankitaluke
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

INSTITUTE OF INFORMATION TECHNOLOGY & MANAGEMENT

Accredited ‘A’ Grade by NAAC &Recognised U/s 2(f) of UGC act


Rated Category `A+’ by SFRC & `A’ by JAC Govt. of NCT of Delhi
Approved by AICTE & Affiliated to GGS Indraprastha University, New Delhi

Assignment-1

Programme: BCA Semester: I Paper Code: BCA 101T Academic Year: 2024-25

Subject Name: Programming for Problem Solving Using C Max. Marks: 20

Course Objectives and mapping with Course Outcomes

S.No Course Outcomes (COs) Questions


Mapping
1. Develop programming skills by learning the fundamentals of
Q1-Q8
structured programming using C Language.
2. Design and develop programs using arrays, storage classes,
functions and to understand memory managements through
pointers.
3. Critically analyze real world problems using structures, unions
-
and develop applications for handling text and binary files.
4. Explore the use of command line arguments, string
-
manipulation and standard libraries.

Last Date for Submission: September 17,2024


Assignment Rubrics
Assessment Criteria Weightage
Information and understanding of the problem 25%
Application/Synthesis of concepts/ Practical Implementation/ Critical Thinking 50%
Conclusion/ Implication/Discussion/Presentation 25%

Guidelines for submission


 The assignment should be handwritten maintained in a neat and clean handwriting.
 Make a separate notebook preferably A4 sized for all C assignments.
 You have to paste the assignment questions hard copy page before starting the
assignment.
The following information should appear on the cover page of the assignment:
o Assignment No
o Submitted to
o Submitted by (Name & Enroll No)
o Date of submission
INSTITUTE OF INFORMATION TECHNOLOGY & MANAGEMENT
Accredited ‘A’ Grade by NAAC &Recognised U/s 2(f) of UGC act
Rated Category `A+’ by SFRC & `A’ by JAC Govt. of NCT of Delhi
Approved by AICTE & Affiliated to GGS Indraprastha University, New Delhi

.
General Instructions

1. Dry run your code first in order to analyse the code behavior, implement it on the system
and then write it.
2. Identify errors in the code that prevent it from producing the correct output or cause it to
fail. Try to identify the cause of error.
3. Correct the errors if any observed while executing the code.
4. Test your corrected code to ensure it works as expected.
5. Submit your corrected code along with comments

Question 1: Write a C program that accepts two integers from the user and performs all basic
arithmetic operations (addition, subtraction, multiplication, and division). Additionally,
increment one of the integers using both prefix and postfix unary operators.

Question 2 : Write a C program that takes a user’s age as input and determines if the person is
eligible to vote. Display “Eligible to vote” if the age is 18 or more; otherwise, display “Not
eligible to vote.”

Question 3: Write a C program that reads a number from 1 to 7 and prints the corresponding
day of the week using a switch statement. Use 1 for Monday, 2 for Tuesday, and so on.

Question 4: Write a C program to calculate the factorial of a number using a for loop. The
number should be taken as input from the user.

Question 5: Write a C program that prompts the user to guess a number between 1 and 100.
The program should continue asking the user to guess the number using a do-while loop until
the correct number is entered.

Question 6: Write a C program that uses the goto statement to jump out of a for loop when a
certain condition is met. The program should print numbers from 1 to 10 but skip the number
5 using goto.

Question 7: Write a C program that accepts three numbers from the user and determines if
they form a valid triangle. For a triangle to be valid, the sum of any two sides must be greater
than the third side.
INSTITUTE OF INFORMATION TECHNOLOGY & MANAGEMENT
Accredited ‘A’ Grade by NAAC &Recognised U/s 2(f) of UGC act
Rated Category `A+’ by SFRC & `A’ by JAC Govt. of NCT of Delhi
Approved by AICTE & Affiliated to GGS Indraprastha University, New Delhi

Question 8: Predict the output for the following code with explanation:

#include <stdio.h>

int main() {
int a = 5, b = 10, c = 15;
int result;

result = a + b * c > a && b - c < a || c / a = =b;

printf("The result of the expression is: %d\n", result);

return 0;
}

You might also like