0% found this document useful (0 votes)
49 views2 pages

C Programming Practical 1

Uploaded by

dhanshree1278
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views2 pages

C Programming Practical 1

Uploaded by

dhanshree1278
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

‭Course Code: 23ADS1102‬ ‭Course Name: C.

Programming Lab‬

‭Name of Students: Dhanshree Gaur‬ ‭Semester : 1st Semester / Section M‬

‭Roll No: M-05‬ ‭Enroll No: 24070403‬

‭Problem Definition:‬‭‬

‭ rite a straight line programmme to display the birthdate entered by the user on‬
W
‭separate lines as date, month and year‬

‭Source Code in C:‬

‭#include <stdio.h>‬

‭int main() {‬

‭int date, month, year;‬

‭printf("Enter the date :\n");‬

‭scanf("%d", &date);‬

‭printf("Enter the month :\n");‬

‭scanf("%d", &month);‬

‭printf("Enter the year :\n");‬

‭scanf("%d", &year);‬

‭printf("The date you entered was : %d-%d-%d", date, month, year);‬

‭return 0;‬

‭}‬
‭Output:‬

‭Conclusion:‬

I‭ n‬ ‭this‬ ‭practical‬ ‭we‬ ‭studied‬ ‭about‬ ‭the‬ ‭use‬ ‭of‬ ‭printf‬ ‭and‬ ‭scanf‬ ‭functions.‬ ‭We‬ ‭also‬ ‭learned‬
‭about‬‭the‬‭concept‬‭of‬‭format‬‭specifiers.‬‭Here,‬‭%d‬‭was‬‭used‬‭as‬‭the‬‭format‬‭specifier‬‭to‬‭specify‬
‭the numerical value of date, month and year.‬

You might also like