






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Information about various assignments given in the mca (master of computer applications) course at ignou (indira gandhi national open university) under the c and assembly language programming lab course (mcs-017). The assignments include writing an interactive c program to generate telephone bills, a program in assembly language to find the perimeter of a rectangle, a program to find the square of a number in assembly language, and a program to reverse a number and check if it is a palindrome in assembly language. The assignments require the students to write, execute, and submit the program logic, sample input, and output along with necessary documentation.
Typology: Exams
1 / 10
This page cannot be seen from the preview
Don't miss anything!







Thanks for visiting us!! Subscribe!! Page 1
Course Code : MCSL- 017 Course Title : C and Assembly Language Programming (Lab Course) Assignment Number : MCA(I)/L-017/Assignment/15- 16 Maximum Marks : 100 Weightage : 25% Write an interactive program in C language to create an application program which generates the telephone bills. It stores various details of users Telephone Number, Name, Address, No. of calls, local or STD/ISD call. Compute the amount to be paid if the charges per local call is Rs. 2/- and for STD/ISD call is Rs. 5/-. It should have feature of searching the customer records using the telephone number. The application should be designed user-friendly. Note: You must execute the program and submit the program logic, sample input and output along with the necessary documentation for this question. Assumptions can be made wherever necessary. #include<stdio.h> #include<dos.h> struct consumer { int TEL_NO; char NAME[10]; char ADDRESS[25]; int LOCAL; int STD_ISD; }USER[12]={ {25621,”GANESH”,”KACHPADA,MALAD W”,15,5}, {25622,”MAHESH”,”DOMNIC COLONY,MALAD W”,30,0}, {25623,”SURESH”,”SUNDER NAGAR MALAD W”,128,15}, {25624,”KALPESH”,”KACHPADA,MALAD W”,826,7}, {25625,”RAHUL”,”DOMNIC COLONY,MALAD W”,24,3}, {25626,”SUBBU”,”SUNDER NAGAR MALAD W”,475,0}, {25627,”RAKESH”,”BHADRAN NAGAR MALAD W”,97,7}, {25628,”ATUL”,”KACHPADA,MALAD W”,152,45}, {25629,”DHARMESH”,”SUNDER NAGAR MALAD W”,326,45}, {25630,”AJAY”,”BHADRAN NAGAR MALAD W”,216,12}, {25631,”ABDUL”,”DOMNIC COLONY,MALAD W”,127,1}, {25632,”RASHMI”,”KACHPADA,MALAD W”,95,5} }; void main() { int TELNO; void gen_bill(int); clrscr(); printf(“ENTER TELEPHONE NO.(BTWN 25621 TO 25632) TO GENERATE BILL : “); scanf(“%d”,&TELNO); if(TELNO>25620 && TELNO<25633) gen_bill(TELNO);
Thanks for visiting us!! Subscribe!! Page 2 else printf(“\nYOU HAVE ENTERED WRONG TEL NO. !!”); getch(); } void gen_bill(int TELNO) { struct date D; float LOCAL_CH,STD_ISD_CH,SER_CH,T_CALLS,T_BILL,FIX_CH=750; getdate(&D); printf(“\n\n\t\t\t MUMBAI TELEPHONE NIGAM LIMITED.”); printf(“\n\t\t\t\tBILL SUMMARY\n\n”); LOCAL_CH=USER[TELNO-25621].LOCAL2; STD_ISD_CH=USER[TELNO-25621].STD_ISD5; T_CALLS=LOCAL_CH+STD_ISD_CH; SER_CH=(FIX_CH+T_CALLS)/10; T_BILL=FIX_CH+T_CALLS+SER_CH; printf(“\tCONS.NAME : %s\t\t\tBILL GEN. DATE:%d/%d/%d “,USER[TELNO- 25621].NAME,D.da_day,D.da_mon,D.da_year); printf(“\n\n\tADDRESS : %s\t\tBILL MONTH : %d %d\n”,USER[TELNO- 25621].ADDRESS,D.da_mon-1,D.da_year); printf(“\n\t_____________________________________________________________________ _”); printf(“\n\n\tNO. OF CALLS\t\t\t\tCHARGES\t\tAMOUNT(RS.)”); printf(“\n\t_____________________________________________________________________ _”); printf(“\n\n\tLOCAL :\t%d\t\t\tMONTHLY(FIXED) :\t%.0f”,USER[TELNO-25621].LOCAL,FIX_CH); printf(“\n\n\tSTD/ISD :\t%d\t\t\tCALL USAGE :\t%.0f”,USER[TELNO-25621].STD_ISD,T_CALLS); printf(“\n\n\t\t\t\t\t\tSERVICE TAX\t\t%.0f”,SER_CH); printf(“\n\t_____________________________________________________________________ _”); printf(“\n\n\t\t\t\t\t\tPAYABLE AMT\t\t%.0f”,T_BILL); printf(“\n\t_____________________________________________________________________ _”); } Code: -
Thanks for visiting us!! Subscribe!! Page 4
Program Code :
Q. Write a program in assembly language to find the Square of a given number. Course Code : MCS- 017 Course Title : C and Assembly Language Programming(Lab Course)
Thanks for visiting us!! Subscribe!! Page 5 Assignment Number : MCA(I)/L-017/Assignment/15- 16 Maximum Marks : 100 Weightage : 25% Solution : DATA SEGMENT NUM DB? RES DB 10 DUP (‘$’) MSG1 DB “ENTER NUMBER : $” MSG2 DB 10,13,”SQUARE OF NUMBER IS : $” DATA ENDS CODE SEGMENT ASSUME DS:DATA,CS:CODE START: MOV AX,DATA MOV DS,AX LEA DX,MSG MOV AH, INT 21H MOV AH, INT 21H SUB AL,30H MOV NUM,AL MOV AH, MUL NUM LEA SI,RES CALL HEX2DEC LEA DX,MSG MOV AH, INT 21H LEA DX,RES MOV AH, INT 21H MOV AH,4CH INT 21H CODE ENDS HEX2DEC PROC NEAR MOV CX, MOV BX,1 0 LOOP1: MOV DX, DIV BX ADD DL,30H
Thanks for visiting us!! Subscribe!! Page 7
Thanks for visiting us!! Subscribe!! Page 8
Thanks for visiting us!! Subscribe!! Page 10