Professional Documents
Culture Documents
DCA-I - C-Lang & PC - 2022-23
DCA-I - C-Lang & PC - 2022-23
PROGRAMMING IN “C”
&
OFFICE AUTOMATION
DCA – I (Sem.)
SESSION -2022-23
SUBMITED TO SUBMITED BY
Mr. R. Chourasia
INDEX
S NO PRACTICAL NAME REMARK
1 WAP FOR FIND GREATER OF ANY THREE NUMBER
2 WAP TO GENERATE GROSS SALARY
3 CHECK A NUMBER IS PRIME OR NOT
4 WAP FOR FINDING ROOTS OF QUARDRATIC EQUATION ( ax2 + bx + c = 0)
5 WAP FOR SWAPPING ANY TWO NUMBER
6 WAP TO PERFORM ARITHMETIC OPERATOR USING SWITCH CASE
7 CALCULATE FACTORIAL OF ANY NUMBER
8 WAP CHECK A NUMBER IS MAGIC NUMBER OR NOT
9 WAP FOR ADDITION OF ARRAY ELEMENTS
10 WAP FOR BUBBLE SORTING
11 WAP FOR LINEAR SEARCH
12 WAP FOR BINARY SEARCH
13 COUNTING VOWELS SPACE & CONSONANT TO A STRING
14 WAP TO CHECK STRING ARE EQUAL OR NOT
15 WAP FOR ADDITION OF TWO STRING
16 WAP FOR TWO MATRIX ADDITION
17 WAP FOR TWO MATRIX MULTIPLICATION
18 WAP TO FIND FACTORIAL OF ANY NUMBER BY USING POINTER
19 WAP TO PRINT OUT FEBONACI SERIES BY USING RECURSIVE FUNCTION
20 WAP TO IMPLIMENT POINTER WITH ARRAY
OFFICE AUTOMATION
S.NO. PARTICULARS SIGN
MS-WORD
1. Type the text as shown below and perform the tasks as directed:-
2. Type and format the text as shown below if any spelling or grammar mistake occurs correct
it using spelling and grammar facility.
MS-EXCEL
1. Create the following worksheet and save the worksheet as wages.xls.
MS-POWERPOINT
1. Write an animated presentation about any three courses available in college.
EXCELL
1. Create the following worksheet and save the worksheet as wages.xls.
5. Create Macro to make selected cell Bold Italic, Outside Bordered and Centre.
MS ACCESS
TALLY
1 HOW TO CREATE A COMPANY IN TALLY.
ASSIGNMENT - 1
#include<stdio.h>
void main()
int a,b,c;
clrscr();
scanf("%d%d%d",&a,&b,&c);
if(a>b)
if(a>c)
else
else
if(b>c)
B C S GOVT. P. G. COLLEGE DHAMTARI Page 5
Student Name->
else
getch();
ASSIGNMENT - 2
#include<stdio.h>
#include<conio.h>
void main()
{
float bp,hr,da,gp;
clrscr();
textcolor(220);
printf("\nEnter the value of basic pay\n\n");
scanf("%f",&bp);
if(bp<=4000)
{
da=0.4*bp;
hr=0.1*bp;
}
if(bp>4000)
{
da=0.5*bp;
hr=0.2*bp;
}
gp=bp+da+hr;
printf("The value of basic pay = %f",bp);
printf("The value of DA = %f",da);
printf("\n\nThe value of HRA = %f",hr);
printf("\n\nThe value of gross pay = %f",gp);
getch();
}
ASSIGNMENT - 3
#include<conio.h>
#include<stdio.h>
void main()
{
int n,i,d=0;
clrscr();
printf("\n\t enter any number \n\t");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
if(n%i==0)
d++;
}
if(d==2)
printf("\n\n\t %d is prime number",n);
else
printf("\n\n\t %d is not prime number",n);
getch();
ASSIGNMENT - 4
/* WAP to find out the roots of quadratic equation ax2+bx+c */
#include<conio.h>
#include<stdio.h>
#include<math.h>
void main()
float a,b,c,d,x1,x2;
clrscr();
scanf("%f%f%f",&a,&b,&c);
d=b*b-4*a*c;
if(d==0)
x1=-b/(2*a);
x2=x1;
else
if(d>0)
x1=(-b/(2*a))+sqrt(d)/(2*a);
x2=(-b/(2*a))-sqrt(d)/(2*a);
else
getch();
ASSIGNMENT - 5
/* WAP FOR SWAPPING ANY TWO NUMBER */
#include<conio.h>
#include<stdio.h>
void main()
int a,b,t;
clrscr();
scanf("%d%d",&a,&b);
t=a;
a=b;
b=t;
getch();
ASSIGNMENT - 6
/* WAP TO PERFORM ARITHMETIC OPERATOR USING SWITCH CASE */
include<stdio.h>
#include<conio.h>
void main()
int a,b;
char n;
clrscr();
scanf("%c",&n);
scanf("%d%d",&a,&b);
switch(n)
case 'A':
break;
case 'S':
break;
case 'M':
break;
case 'D':
break;
default :
break;
getch();
ASSIGNMENT - 7
/* CALCULATE FACTORIAL OF ANY NUMBER */
#include<conio.h>
#include<stdio.h>
void main()
{
int n,i,d=1;
clrscr();
for(i=1;i<=n;i++)
{
d=d*i;
}
getch();
ASSIGNMENT - 8
/* CHECK A NUMBER IS MAGIC NUMBER OR NOT */
#include<conio.h>
#include<stdio.h>
void main()
{
int n,a,s=0,n1;
clrscr();
printf("\n\t enter any number \n\t");
scanf("%d",&n);
n1=n;
while(n!=0)
{
a=n%10;
s=s+(a*a*a);
n=n/10;
}
if(s==n1)
printf("\n\n\t %d is magic number",n1);
else
printf("\n\n\t %d is not magic number",n1);
getch();
}
ASSIGNMENT - 9
/* write a program for additon of array elements */
#include<stdio.h>
#include<conio.h>
void main()
{ int a[15],i,s=0,n;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
for(i=0;i<n;i++)
printf("%3d",a[i]);
s=s+a[i];
getch();
ASSIGNMENT - 10
/* BUBBLE SORTING */
#include<stdio.h>
#include<conio.h>
void main()
{
int a[20],j,n,i,t;
clrscr();
for(i=0;i<n;i++)
{
for(j=0;j<n-i-1;j++)
{
if(a[j]>a[j+1])
{
t=a[j];
a[j]=a[j+1];
a[j+1]=t;
}
}
}
getch();
}
ASSIGNMENT -11
/* WAP FOR LINEAR SEARCH */
#include<stdio.h>
#include<conio.h>
void main()
int a[20],n,i,data;
clrscr();
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
for(i=0;i<n;i++)
printf("\t%d",a[i]);
scanf("%d",&data);
for(i=0;i<n;i++)
if(a[i]==data)
break;
if(i==n)
getch();
ASSIGNMENT - 12
/* BINARY SEARCH */
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10],loc,n,beg=0,end,i,mid,data,j,k;
clrscr();
for(i=0;i<n;i++) {
for(j=i+1;j<n;j++)
{
if(a[i]>a[j])
{
k=a[j];
a[j]=a[i];
a[i]=k;
}
}
}
printf("\n\n\nThe shorted list are:\n\n");
for(i=0;i<n;i++)
printf("%3d",a[i]);
end=n-1;
mid=(beg+end)/2;
printf("\n\n\n if u want search again type's'\n");
if(getch()=='s')
{
printf("\n\n\nEnter the element which search into list:\n");
scanf("%d",&data);
while(beg<=end&&a[mid]!=data)
{
if(data<a[mid])
end=mid-1;
else
beg=mid+1;
mid=(beg+end)/2;
}
if(a[mid]==data)
{
loc=mid;
printf("The data location is = %d ",loc);
printf("\n\n\nThe data is = %d",a[mid]);
}
else
{
if((data!=a[mid]||beg>end))
printf("The search is unsuccessful");
getch();
}
ASSIGNMENT - 13
/* COUNTING VOWELS SPACE & CONSONANT TO A STRING */
#include<stdio.h>
#include<conio.h>
void main()
{ char str[50];
int i,s=0,v=0,c=0;
clrscr();
gets(str);
for(i=0;str[i]!='\0';i++)
switch(str[i])
case 'a':
case 'A':
case 'i':
case 'I':
case 'o':
case 'O':
case 'u':
case 'U':
case 'e':
case 'E':
v++;
break;
s++;
break;
default:
c++;
getch();
ASSIGNMENT - 14
/* CHECK STRING ARE EQUAL OR NOT */
#include<stdio.h>
#include<conio.h>
void main()
char str1[20],str2[20];
int l1,l2,i;
clrscr();
scanf("%s",str1);
scanf("%s",str2);
for(l1=0;str1[l1]!='\0';l1++);
for(l2=0;str2[l2]!='\0';l2++);
if( l1==l2 )
for(i=0;i<l1;i++)
if(str1[i]!=str2[i])
break;
if(i==l1)
else
else
getch();
ASSIGNMENT - 15
/* WAP FOR ADDITION OF TWO STRING */
#include<stdio.h>
#include<conio.h>
void main()
char str1[20],str2[20],str3[40];
int j,i,len1,len2;
clrscr();
scanf("%s",str1);
scanf("%s",str2);
for(len1=0;str1[len1]!='\0';len1++);
for(len2=0;str2[len2]!='\0';len2++);
for(i=0;str1[i]!='\0';i++)
str3[i]=str1[i];
str3[i]=' ';
i++;
for(j=0;str2[j]!='\0';j++,i++)
str3[i]=str2[j];
str3[i]='\0';
printf("%s\n",str3);
getch();
ASSIGNMENT - 16
/* WAP FOR TWO MATRIX ADDITION */
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5][5],b[5][5],c[5][5];
int i,j,r1,r2,c1,c2;
clrscr();
if( (r1==r2)&&(c1==c2) )
{
//INPUT 1ST MATRIX
printf("\nEnter the element of first metrix :\n\n");
for(i=0;i<r1;i++)
{
for(j=0;j<c1;j++)
scanf("%d",&a[i][j]);
//MATRIX ADDITION
printf("\n\nthe metrix addition :\n\n");
for(i=0;i<r1;i++)
{
printf("\n\t");
for(j=0;j<c1;j++)
{
c[i][j]=a[i][j]+b[i][j];
printf("%3d",c[i][j]);
}
}
}
else
printf("\n\n matrix addition not possible");
getch();
}
ASSIGNMENT - 17
/* WAP FOR TWO MATRIX MULTIPLICATION */
#include<stdio.h>
#include<conio.h>
void main()
{
int a[10][10],b[10][10],c[10][10];
int sum=0,r1,r2,c1,c2,i,j,k;
printf("enter the value of r1,r2,c1,c2\n\n");
scanf("%d%d%d%d",&r1,&c1,&r2,&c2);
for(i=0;i<r2;i++)
{
for(j=0;j<c2;j++)
scanf("%d",&b[i][j]);
}
for(i=0;i<r1;i++)
{
for(j=0;j<c1;j++)
printf("%d\t",a[i][j]);
printf("\n\n");
}
printf("\nthe 2nd matrixis\n\n");
for(i=0;i<r2;i++)
{
for(j=0;j<c2;j++)
printf("%d\t",b[i][j]);
printf("\n\n");
}
printf("\nthe matrix multipication\n\n");
for(i=0;i<r1;i++)
{
for(j=0;j<c2;j++)
{
for(k=0;k<c1;k++)
{
c[i][j]=sum+a[i][k]*b[k][j];
}
printf("%d\t",c[i][j]);
sum=0;
}
printf("\n\n");
}
getch();
}
ASSIGNMENT - 18
/* WAP TO FIND FACTORIAL OF ANY NUMBER USING POINTER*/
#include<stdio.h>
#include<conio.h>
void main()
int *p,n,i,f=1;
clrscr();
scanf("%d",&n);
p=&n;
for(i=1;i<=*p;i++)
f=f*i;
getch();
ASSIGNMENT - 19
/* write a program for fiboneci series using recursive function */
#include<conio.h>
#include<stdio.h>
int fibbo(int);
void main()
int n,i=0;
clrscr();
scanf("%d",&n);
while(i<n)
i++;
printf("%d\n",fibbo(i));
getch();
int fibbo(int i)
if((i==1)||(i==0))
return(0);
if(i==2)
return(1);
if(i>2)
return(fibbo(i-1)+fibbo(i-2));
ASSIGNMENT - 20
/* WAP TO IMPLIMENT POINTER WITH ARRAY */
#include<stdio.h>
#include<conio.h>
void main()
{ int a[50],i,*p,n,sum=0;
scanf("%d",&n);
for(i=0;i<n;i++)
scanf("%d",&a[i]);
for(i=0;i<n;i++)
printf("Address a[%d]=%u\n\n",i,&a[i]);
p=a;
for(i=0;i<n;i++)
sum=sum+(*(p+i));
} printf("\n\nSum = %d",sum);
getch();
OFFICE
AUTOMATION
1. Type the text as shown below and perform the tasks as directed:-
Computers
EXPERT SYSTEMS
(i) Search for the word ‘Computer’ in the entire document. All the occurrences
of the given word are to be searched irrespective of the case.
(ii) In the above question note that word also searches ‘computerization’ and
‘computerizations’ . Now make sure that this time word searches only for the word
‘computer’ in the entire document.
Top margin: 1.5”, bottom margin: 1.5” gutter”, left margin: 1.5”
Right margin: 1, page width: 7.5”, page height: 6.5”, orientation: portrait.
Q-2. Type and format the text as shown below if any spelling or grammar mistake
occurs correct it using spelling and grammar facility.
DELHI
New Delhi, the capital and largest city of India is a fusion of the ancient and modern.
The remains of the Muslim dynasties with its architectural delights, give the majestic
ambience of the bygone era.
On the other side New Delhi, The imperial city built by British, reflects the fast
paced present. The most fascinating of all is the character of Delhi which varies
from the 13th century mausoleum of the Lodi kings to ultra modern glass
skyscrapers.
Solu:- (i) Type the text as shown, pressing enter key after each paragraph.
(iii) Select the two paragraphs and use Home->Paragraph->indent left: 0.5->OK.
Character Formatting
4H3PO3=3H3PO4+PH3
PCL3+CL2=PCL5
Solu:- Type the text then after typing text select the digits (firstly select any digit
then hold down control and go on selecting remaining digits). Use Home->Font-
>Subscript->OK.
1) Own house
2) Car
Solu:- (i) While typing sub items within own house you have to press tab key once,
similarly ; before typing sub items within car you have to press tab key once.
(ii) Select the whole text and use bullets and numbering->click on list style tab-
>add-> Apply formatting to: 1st level-> click on number icon, apply formatting to:
2nd level-> click on bullets icon->OK->OK.
Admission 2005-06
14 25 6 5 50
Commerce
Grand Total 87
(ii) Click on cell and type text for cells except for the last row. Use tab key to
navigate.
(iii) To use border the last row select first 5 cell from the last row and use merge
cells by right click of the mouse button then type text ’Grand’ Total’, then click
‘align centre’.
(iv) Position insertion point on the last cell of the last row use Layout-> Formula.
MS-EXCEL
Question1. Create the following worksheet and save the worksheet as wages.xls.
Pay rate 95
Kushagra 3-Mar-07
Pradeep 4-Mar-07
Puneet 5-Mar-07
Rajeev 6-Mar-07
Answer:-
C6=B3-B6=488
C7=B3-B7=487
C8=B3-B8=486
B C S GOVT. P. G. COLLEGE DHAMTARI Page 47
Student Name->
C9=B3-B9=485
D6=B4*C6=46360
D7=B4*C7=46265
D8=B4*C8=46170
D9=B4*C9=46075
Question2. Create the following worksheet and save the worksheet as wages.xls.
Answer:-
(i) Calculate the total salary as sum of basic, HRA, DA, for each employee for 1997.
Ans. Calculation: -
(ii) Calculate total salary for year 1998 as sum of 1997 and bonus.
Ans. Calculation: -
Answer :-
(i) Allow bonus 8000 to employee having service> 2 year otherwise allow bonus
3000.
Calculate bonus: -
E3 = if(year (B1)-year(C3)>2,8000,3000)
E4 = if(year (B1)-year(C4)>2,8000,3000)
E5 = If(year (B1)-year(C5)>2,8000,3000)
E6 = if(year (B1)-year(C6)>2,8000,3000)
MS-POWERPOINT
Q1. Write an animated presentation about any three courses available in college.
B.COM
ELIGIBILITY 12TH PASS
DURATION 3 YRS
FEES 11,000
BCA
ELEGIBILITY 12TH PASS
DURATION 3 YRS
FEES 31,000
BBA
ELEGIBILITY 12TH PASS
DURATION 3 YRS
FEES 21,000
STEPS:-
(ii)When box appears ,it asks you to enter the no. of rows and columns and click OK
button.
(i) Open the presentation you want to apply a design to. Click on design menu and apply
selected design.
Solu:
Relationships:-
Q.5 Create a table in MS access with database “student” containing a student table
,fees table and grade table and creating relationship between the tables.
Sol:- steps
(i) The first step is to create a new database to store the data. Here create a
database “student” with 3 tables having name:-
a) Student table
b) Fees table
c) Grade table
1) Choose new from the file menu in the access opening screen. A window is
displayed which asks for the name of new database.
2) Type the file name as student.accdb
3) Click the create button to create the database.
4) The database window is displayed on the screen. From the database window
screen double click on the table for creating table in design view.
Creating table:-
1) to create the table click on design view.
2) now type field name in field column & give the datatype.
3) save the student table.
Foxpro
Q1 :– Calculate and Print the Multiplication Table of a Number entered
Solution:
ans=”y”
do while ans=”y”
clear
input “enter the table to print :” to t
i=1
do while i <=10
p=t*i
?str(t)+ “ *” + str(i,4) + “ = ” + str(p,4)
i=i+1
enddo
accept “want to print another table :” to ans
enddo
Solution:
function sumdigit
para num
sum=0
num=alltrim(str(num))
lgt=len(num)
i=1
do while i <= lgt
s=substr(num,i,1)
sum=sum+val(s)
i=i+1
enddo
return sum
Solution:
clear
accept “enter name” to nm
nm = alltrim(nm)
res=””
a=0
for i=1 to cntSPace
res=res + substr(nm,a+1,1) + “. ”
a = at(” “,nm,i)
?”a”,a
endfor
res=res + substr(nm,a)
?”result is : ” + res
Solution:
?”*********************”
?”S” at 7
??”M” at 12
??”T” at 17
??”W” at 21
??”Th” at 27
??”F” at 32
??”SA” at 37
?
colm=0
for r = 1 to 5
for c = 1 to 7
if a(r,c) <> 0 then
?? str(a(r,c),5) at colm + c*5
endif
endfor
?
endfor
proc calcdays
**************
do case
case mn =1 or mn= 3 or mn= 5 or mn= 7 or mn= 8 or mn= 10 or mn= 12
mndays = 31
case mn= 4 or mn= 6 or mn= 9 or mn=11
mndays = 30
case mn = 2
if mod(yr,4) = 0 and not mod(yr,100)<> 0 then
mndays = 29
else
if mod(yr,4)=0 and mod(yr,100) = 0 and mod(yr,400) = 0 then
mndays = 29
else
mndays = 28
endif
endif
endcase
Solution:
Browse
A Browse window allows you to view records in a table, edit those records, and
append
additional records. Visual FoxPro allows you to have several Browse windows open
at the same
time.
eg. This will open the invidx table so its contents can be viewed
Use invidx
Browse
Copy To
Creates a new file from the contents of the currently selected table.
eg. This will Copy the invln table to a new table test1
Use invln
Copy to test1
Delete
Marks records for deletion.
eg. This will delete all of the records from the Products table with a Location = 0
Use Products
Delete for Location=0
For
The For command is used to specify a criteria the desired action is to be taken on.
eg. This will display entries in the fintrans table with a value in the Audit field of
35164
Use fintrans
Browse For Audit=35164
Modify Label
Opens the Label Designer to create or modify a label.
eg. This will open the barcode label for modifying
Modify label barcodes
Modify Report
Opens the Report Designer to create or modify a report.
eg. This will open the report inv01 for modifying
Modify report inv01
Quit
Ends the current Visual FoxPro session and returns control to the operating system.
Replace
Replaces data in a field with the value in an expression. Fields in unselected work
areas must
NB: Use with care as all items deleted can not be recalled
TALLY
Q.1 HOW TO CREATE A COMPANY IN TALLY.
Solution:
Once the software is downloaded, start the Tally.erp 9, and the below screen will
appear. It will prompt to create a company, if there is no company created or loaded
and so, the Select option is disabled automatically. Now just read the full articles
here for company creation in Tally.
Now hit Create company button and you will find below screen
Note : You may alter name and address at any time latter on you wish so.
If your office location is in Mumbai from where you have to prepare books of
account,and your business unit is in Delhi,then you have to select your state as Delhi
and not Maharashtra.
Now you have to select method of accounts i.e. Accounts only or Accounts with
inventory
If you select accounts only then you will not be able to keep record of inventory.
Accounting year is a period for which books of accounts are being managed.
Calendar year is the year starting from 1st January of any year and ends on 31st
December of the same year.
Solution:
Go to Gateway of Tally > Accounts Info. > Voucher Type >Alter > Purchase
Give a name to the class under Name of Class say Purchase Class. You can create
more than one class. (Make sure that Enter Purchases in Invoice Format in F11
feature is enabled to create class). Create the Class as follows:
In Default Accounting Allocations for each Item in Invoice (except for the items
specified below) section
Select the Purchase Ledger – Local Purchases. All the stock items that will be
entered in the voucher using this class, except for those specified in the
Default Accounting Allocations for section, will be automatically allocated to
Local Purchases. Of course, the stock item record remains as it is and can be
viewed separately
Set the option Default Accounting Allocations for to Not Applicable (Refer to
Voucher Class - Allocation of Stock Item for the usages of this option).
2. Record Purchase
Go to Gateway of Tally > Accounting Vouchers > F9 Purchase > and select the Class
You will observe that the Ledger Accounts grouped under Sundry Debtors are also
listed as you have not specified any condition to exclude Sundry Debtors Group. If
you have specified Sundry Debtors under Exclude option, then Tally would have
displayed the Ledgers excluding those Ledgers grouped under Sundry Debtors.
Please note that the Freight Ledger is automatically displayed and the user has to
only specify the value.
Once you select Item B, specify the Quantity and rate, the value will be
automatically calculated and the cursor will directly move to the Name of Item field
instead of popping up the Accounting Allocations for screen.
Solution:
Go to Gateway of Tally > Accounts Info > Ledgers > Single Ledger > Create
Name
Enter the Name of the account. You can provide the full name of the account.
Tally.ERP 9 fits it all in. Press Enter to move to the next field. Tally.ERP 9 does not
allow the entry of duplicate names. The uniqueness check is made here itself.
Note that the punctuation and other non-relevant information are ignored by
Tally.ERP 9 in its recognition of a name. Thus, CST, C.S.T. and C. S. T. are all
considered as same.
Tally.ERP 9 converts the first letter of all relevant words to upper case, which helps
you; speed up data entry.
Solution:
Go to Gateway of Tally > Display > List of Accounts > Ctrl+V [Voucher Types]
Or
Go to Gateway of Tally > Accounts info / Inventory Info > Voucher types > Alter
Even if you do not need extra voucher types, you would normally alter the
predefined voucher types to customise them according to your needs, e.g., to control
their numbers.
Go to Gateway of Tally > Accounts info / Inventory Info > Voucher types > Alter