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

EXPERIMENT NUMBER – 3.

2
STUDENT NAME – Aman Kumar
STUDENT UID – 21BCS3224
CLASS AND GROUP -PH21BCS413- ‘A’
SEMESTER- 1st

AIM OF THE EXPERIMENT –

Define a structure type,

personal, that would contain

person name, date of joining

and salary. Using this

structure, write a program

to read this information for

one person from the key

board and print the same on

the screen.

FLOWCHART/ ALGORITHM

Step 1 : Start.
Step 2 : Define the variable type inside structure.
Step 3 : Enter the name and detail of person.
Step 4 : Print the output entered by the user accordingly.
Step 5 : End.

PROGRAM CODE
#include<stdio.h>

struct personal {char name[20]; int day; char month[10]; int year;
float salary; };

int main()

{struct personal person;

SUBJECT NAME-Fundamentals of Computer Programming SUBJECT CODE-21CSH101


printf("Input Values\n--Name\n--Day of joining\n--Month of
joining\n--Year of joining\n--Salary per month\n");

scanf("%s %d %s %d %f", person.name, &person.day, person.month,


&person.year, &person.salary);

printf("\nName-%s\nDay-%d\nMonth-%s\nYear-%d\nSalary-%.2f\
n",person.name, person.day, person.month, person.year,
person.salary);

PROGRAMS’ EXPLANATION (in brief)


The program use structure to perform the task.
The variable type is defined inside structure and is used after in code when called.

OUTPUT

SUBJECT NAME-Fundamentals of Computer Programming SUBJECT CODE-21CSH101


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

SUBJECT NAME-Fundamentals of Computer Programming SUBJECT CODE-21CSH101

You might also like