Professional Documents
Culture Documents
Cse - Term
Cse - Term
SUBMITTED BY:Name: Jagraj Singh Regn. No.: 10807772 Section: 211 Roll No: R211A23 Course: B.Tech-MBA ECE
INTRODUCTION
C is a general purpose structured powerful modern language. It is a high level scientific language as well as business oriented language. This language also has low level programming features. This language was designed for developing fast, reliable, efficient, economical and portable system software and application software (programs). Till the development of c, no language was simple and fully featured to fulfill all types of requirements some languages was powerful. But C fulfilled both the things i.e., simplicity and power to do versatile jobs. Same as in this source code of C programming a short and reliable technique is applied to fulfill our problem in shorter form. In this code first compiler compiles the code then prints an output and ask user to enter DATE, MONTH and YEAR, after entering these formalities C compiler again complies and gave us the output on the screen. And now this C language is being widely used in computer programs and in some software as well as in some windows developing companies. This language is the basic language in other computer language.
Features of C-language: C-language has a number of characteristics or features. Due to this C-language becomes popular among the scientists for development of scientific software, as an entertainment for developing the games package and among businessman for the development of business application oriented tools. So, C-language has number of properties which are explained as: 1. C-language is rich in built-in functions or standard functions (library functions). 2.C-programming are very efficient and have fast execution speed 3.C-language has more data types than other languages (except Boolean operators as there in Pascal Java). 4.C-language has 40 keywords (reserve words) among which 32 are standard keywords which are used in daily routine programming. Eight keywords are optional which are used in low level programming. 5.C-language has more operators than the other language.
ACKNOWLEDGEMENT
I Jagraj Singh of section 211 course B.Tech-MBA (ECE), registration no. 10807772 is hereby submit this term paper of Foundation of Computing to Miss. Harpreet Kaur mam on the topic To know the date of birth when the Day of birth is known. This term paper was submitted with the help of my teacher also from the help of dept. of computing. All the teachers of dept. help me in completing my term paper. I completed this task of programming making and being a developing programmer I thanks to mam supporting me which will help me in the future.
SOURCE CODE:
/*Programm to know the day when date is entered by the user*/ #include<stdio.h> #include<conio.h> main() { int d,m,y,year,month,day,i,n; clrscr(); printf("\n\n\tEnter the date of birth: "); printf("\n\t\tDATE: "); scanf("%d",&d); printf("\t\tMONTH: "); scanf("%d",&m); printf("\t\tYEAR: "); scanf("%d",&y); if(d>31 || m>12 || (y<1900 || y>=3000)) { printf("INVALID INPUT"); getch(); exit(0); } year=y-1900; year=year/4; year=year+y-1900; switch(m) { case 1: case 10: month=1; break; case 2: case 3: case 11: month=4; break;
case 7: case 4: month=0; break; case 5: month=2; break; case 6: month=5; break; case 8: month=3; break; case 9: case 12: month=6; break; } year=year+month; year=year+d; day=year%7; switch(day) { case 0: printf("\n\n\t\tDay of birth is SATURDAY"); break; case 1: printf("\n\n\t\tDay of birth is SUNDAY"); break; case 2: printf("\n\n\t\tDay of birth is MONDAY"); break; case 3: printf("\n\n\t\tDay of birth is TUESDAY"); break; case 4: printf("\n\n\t\tDay of birth is WEDNESDAY"); break; case 5: printf("\n\n\t\tDay of birth is THURSDAY"); break; case 6: printf("\n\n\t\tDay of birth is FRIDAY"); break; } getch(); return 0; }
OUTPUT:
Enter the date of birth: DATE:6 MONTH:9 YEAR:1990 Day of birth is THUSDAY
ADVANATAGES:
1.By this program we are able to clarify the day of birth of any year easily. 2.There is no need to use any kind of extra formality. 3.User friendly program in c language. 4.It will help in all kind of govt. jobs and some management system also. 5.It gives us output in a very systematic manner.
DISADVANTAGES:
1. To calculate we have to compile this program through compiler only. 2. This program will on C prompt only.
BIBLOGRAPHY:
WIKIPEDIA encyclopedia. ENCARTA encyclopedia Programming in C K.S.Kahlon Introduction of C ANSI C programming language. Let us C