WORKSHEET 2 Final

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

EXPERIMENT NUMBER 2

NAME – SARTHAK ROUT


UID – 21BCS6312
CLASS AND GROUP – AIML-2 A
SEMESTER - 1
SUBJECT NAME - FUNDAMENTALS OF COMPUTER PROGRAMMING

AIM OF THE EXPERIMENT

 WAP which implements the working of all Bit-wise operators.

 WAP to find largest out of three numbers by using ternary operator.

 WAP to check whether entered year is leap or not.

FLOWCHART/ ALGORITHM

Program 2.a:

1.START
2.Initialize X and Y
3. Calculate Z&Y and print
4. Calculate X|Y and print
5. Calculate X^Y and print
6. Calculate ~X and print
7. Calculate Y<<2 and print
8. Calculate Y>>2 and print
9. STOP

Program 2.b:

1.START
2. Define variables a, b, c as int data types
3. Input 3 numbers of your choice to be stored in a, b, c
4. Checks if a is greater than b and c both and if yes then prints a is greatest
5. Checks if b is greater than c and if yes then prints b is greatest
6. Prints c is greatest
7. STOP

Program 2.c:

1.START
2. Define variable year as int data types
3. Input year of your choice to be stored in year
4. Checks if it is leap year, if yes then prints leap year
5. Checks if it is century year, if yes then prints century year
6. Prints not a leap year
7. STOP
PROGRAM CODE

Input 2.a

Input 2.b

Input 2.c

ERRORS ENCOUNTERED DURING PROGRAM’S EXECUTION


(Kindly jot down the compile time errors encountered)

1. Syntax Error
2. Runtime Error
3. Logic Error
PROGRAMS’ EXPLANATION (in brief)
Program 2.a:
This program functions to show the output of various bitwise operators.

Program 2.b: -
This program functions to find out the greatest number in a group of 3 numbers using ternary operators.

Program 2.c: -

This program functions to find if the year is a leap year, century year or neither.

OUTPUT

Output 2.a

Output 2.b

Output 2.c
LEARNING OUTCOMES

 Remember the concepts related to fundamentals of C language, draw flowcharts and


write algorithm/pseudocode.

 Understand the way of execution and debug programs in C language.

 Apply various constructs, loops, functions to solve mathematical and scientific


problem.

 Analyze the dynamic behavior of memory by the use of pointers.

 Design and develop modular programs for real world problems using control
structure and selection structure.

EVALUATION COLUMN (To be filled by concerned faculty only)

Sr. No. Parameters Maximum Marks


Marks Obtained
1. Worksheet Completion including writing 10
learning objective/ Outcome
2. Post-Lab Quiz Result 5

3. Student engagement in Simulation/ 5


Performance/ Pre-Lab Questions
4. Total Marks 20

You might also like