Computer Basic 30 Question With Answer.
- Class 11,12 Computer Science.
- Loksewa computer operator questions.
- Banking computer questions.
- Computer Programming.
1.What is word processor?
Ans: Word
processor is the type of computer program used to write and revise documents, compose the layout of the
text, and preview on a computer monitor
how the printed copy will appear.
2. Write is the features of word processor.
Ans: The features of word processor are:
a. spelling checking,
b. supports for graphics and sound,
c. mail merge, etc.
3.Explain some MS-Word command which you are use in practical lab.
Ans:
Some MS-Word commands which
I have use in practical lab are:
·
Ctrl+N is used to create a new document,
·
Ctrl+O is used to open an existing
document,
·
Ctrl+S is used to save a document,
·
F12 is used to open the save as
dialog box,
·
Ctrl+W is used to close a document,
·
Ctrl+Z is used to undo an action,
·
Ctrl+Y is used to redo an action, etc.
4.What is spreadsheet, worksheet, work book?
Ans: A
spreadsheet is a computer application for computation, organization, analysis and storage of data in tabular form.
A worksheet is a single page in a file created
with an electronic spreadsheet program
such as Microsoft Excel or Google Sheets.
A workbook is the name given to an Excel file and
contains one or more worksheets.
5.Write the features of Ms-Excel.
Ans: The features
of MS-Excel are;
·
inserting,
·
page lay outing,
·
conditional formatting,
·
multiple rows, column, etc.
6.Explain some examples which you are performed in practical lab.
Ans: #include<stdio.h>
#include<conio.h>
Void main( )
{
int num;
clrscr ( );
printf (“input a number:”);
scanf (“%d”, num);
if (num%2==0)
goto label11;
else
goto label12;
label11:
printf (“%d” is even”, num);
label12:
printf (“%d” is odd”, num);
getch( );
}
OUTPUT:
input a number : 8
8 is even
II.
#include<stdio.h>
#include<conio.h>
void main( );
{
int a, b, c; clrscr ( );
for (a=1; a<=5; a++)
{
printf (“\nMultiplication table no. of %d, a);
for (b=1; b<=10; b++)
{
c=a*b;
printf (“\n%d * %d=%d”, a, b, c);
}
}
getch( );
}
OUTPUT:
Multiplication table no. of 1
1 * 1 = 1
1 * 2 = 2
1 * 3 = 3
1 * 4 = 4
1 * 5 = 5
1 * 6 = 6
1 * 7 = 7
1 * 8 = 8
1 * 9 = 9
1 * 10 = 10
7.Design a web page about any topic
using different types HTML tags.
Ans:
<html>
<head>
<meta charset="utf-8">
<title>Black Goose Bistro</title>
</head>
<body>
Black Goose Bistro
<br>
The Restaurant
The Black Goose Bistro offers
casual lunch and dinner fare in a hip atmosphere. The menu changes
regularly to highlight
the freshest ingredients.
<br> Catering
You have fun... we'll
do the cooking. Black Goose catering can handle events
from snacks for bridge club to elegant corporate fundraisers.<br>
Location and Hours Seekonk,
Massachusetts; Monday through
Thursday 11am to 9pm, Friday and Saturday, 11am to midnight
</body>
</html>
8. What is C language?
Ans: C
language is a general-purpose, procedural computer programming language
supporting structured programming, lexical variable scope, and
recursion, with a static type system.
9. Write the features of C language.
Ans: The features of C language
are:
·
Procedural Language.
·
Fast and Efficient.
·
Modularity.
·
Statically Type.
·
General-Purpose Language.
·
Rich set of built-in Operators.
·
Libraries with rich Functions.
·
Middle-Level Language.
10.Disadvantages of C language.
Ans: Some disadvantages of C language
are:
·
Lack of object orientation.
·
Inefficient memory management.
·
No garbage collection.
·
Run-time checking.
·
Concept of namespace
is not present in C.
·
Absence of exception
handling.
·
Lacks constructor and destructor
11.Applications areas of C language.
Ans: Some application areas of C language
are:
·
Operating Systems: first operating
system, UNIX which was designed in the C programming.
·
used in embedded
systems.
·
used in GUI.
·
used for New Programming Platforms.
·
used in Google.
·
used in Mozilla
Firefox and Thunderbird.
·
used in MySQL.
·
used for Compiler
Design.
12.Program to print Hello World
in C language.
#include<stdio.h> #inclue<conio.h> void main()
{
clrscr();
printf("Hello World"); getch();
}
13.Program to the arithmetic operators. #include<stdio.h> #inclue<conio.h>
void main()
{
int a=3,b=24,add,subs,multi; add=a+b;
subs=b-a; multi=a*b; printf("%d %d
%d",add,subs,multi); getch();
}
14.Program to explain
the selection control
structure (if,if…..else,if….else if, switch.
statements).
#include<stdio.h> #inclue<conio.h> void main()
{
int a,b,c;
printf("enter the
numbers"); scanf("%d%d%d", &a,&b,&c); if (a>b&&a>c)
{
printf("%d is the greatest",a);
}
else if(b>a &&b>c)
{
printf("%d is the greatest",b);
}
else
printf("%d is the greatest",c);
getch();
}
15.Program to explain the looping (iteration) control structure ( for, while
and do while statements).
|
For looping #include<stdio.h> #inclue<conio.h> void
main() |
While
looping #include<stdio.h> #inclue<conio.h> void
main() |
Do while #include<stdio.h> #inclue<conio.h> void
main() |
|
{ |
{ |
{ |
|
int i=1; |
int i=1; |
int i=1; |
|
for (i=1;i!=10;i++) |
while(i<=10) |
do |
|
{ |
{ |
{ |
|
printf("%d,i); |
printf("%d",i); |
printf("%d",i); |
|
} |
i=i+1; |
i=i+1; |
|
getch(); |
} |
}while(i!=10); |
|
} |
getch(); } |
getch(); } |
16. Program to find find the sum of digits of any given number.(eg:123--6)
#include<stdio.h> #inclue<conio.h> void main()
{
int a,r,sum; while(a!=0)
{
r=a%10;
sum=sum+r; a=a/10;
}
printf("sum of digits is %d",sum); getch();
}
17.
Program to display any given number in reverse order.(eg:123=321)
#include<stdio.h> #inclue<conio.h> void main()
{
int a,r,rev; while(a!=0)
{
r=a%10;
rev=rev*10+r; a=a/10;
}
printf("reverse is %d",rev); getch();
}
18.Program to find any given number
is palindrome number or not.
#include<stdio.h> #inclue<conio.h> void main()
{
int a,temp,r,pali; printf("enter a number",&a); temp=a;
while(temp!=0)
{
r=temp%10; pali=pali*10+r; temp=tepm/10;
}
if (pali==a)
{
printf("palindrome number");
}
else
{
printf("not palindrome number");
}
getch();
}
19.Program to find any given number is armstrong number or not.
#include<stdio.h> #inclue<conio.h> void main()
{
int a,temp,r,arm; printf("enter a number",&a); temp=a;
while(temp!=0)
{
r=temp%10; arm=arm+r*r*r; temp=temp/10;
}
if (arm==a)
{
printf("armstrong number");
}
else
{
printf("not armstrong number");
}
getch();
}
20.Program to find the
factorial of any given number.
#include<stdio.h> #inclue<conio.h> void main()
{
int
a,f=1,i;
printf("enter a number"); scanf("%d",&a); for(i=1,i!=a;i++)
{
f=f*i;
}
printf("factorial is
%d",f); getch();
}
21.Program to find the common factor of any two given number.
#include<stdio.h>
#inclue<conio.h> void
main()
{
int a,b,i,r1,r2; printf("enter numbers"); scanf("%d%d",&a, &b); for(i=1;i!=0;i++)
{
r1=a%i; r2=b%i;
if (r1==0 && r2==0) printf("%d",i);
}
getch();
}
22.Program to find HCF and LCM of any two given number.
#include<stdio.h>
void main(){
int a,b,x,y,t,hcf,lcm;
printf(“Enter 1st
number”);
scanf(“%d”,&x);
printf(“Enter 2nd
number”);
scanf(“%d”,&y);
a=x;
b=y;
while(b!=0)
{
t=b;
b=a%b;
a=t;
}
hcf=a;
lcm=(x*y)/hcf;
printf(“%d is the hcf and %d
is the lcm”,hcf,lcm);
getch();}
23.Program to find multiplication table of any given number
upto 10 multiple.
#include<stdio.h> #inclue<conio.h> void main()
{
int i,a;
printf("enter a number"); scanf("%d",&a);
for(i=1;i<=10;i++)
{
printf("%d * %d = %d",a, i, a*i);
}
getch();
}
24.Program to generate
the following series.
|
i. 1,3,5,7……19 #include<stdio.h> #inclue<conio.h> void
main() { int i=1; while(i<=19) { printf("%d",i); i=i+2; } getch(); } |
ii. 2,4,8,16…..upto
10th terms. #include<stdio.h> #inclue<conio.h> void
main() { int i, a=2; for(i=1;i<=10;i++) { printf("%d",a); a=a*2; } getch(); } |
|
iii. 1,4,9,16…..upto 10th terms. #include<stdio.h> #inclue<conio.h> void
main() { int i,a; for(i=1;i<=10;i++) { a=i*i; printf("%d",a); } getch(); } |
iv.3,33,333…..upto 5th terms. #include<stdio.h> #inclue<conio.h> void
main() { int i, a=3; for(i=1;i<=5;i++) { printf("%d",a); a=a*10+3; } getch(); } |
|
v. 100,90,81,73…..upto 10th terms. #include<stdio.h> #inclue<conio.h> void main() { int i, b=100;
for(i=1;i<=10;i++) { printf("%d",b); b=b-9-i; } getch(); } |
vi.1,1,2,3,5,8…..upto
15th terms. #include<stdio.h> #inclue<conio.h> void main() { int i,a,b,c; printf("%d%d",a,b); for(i=1;i<=10;i++) { c=a+b; printf("%d",c); a=b; b=c; } getch(); } |
|
vii. 7,22,11,34…..upto 10th terms. #include<stdio.h> #inclue<conio.h> void
main() { int i
,n=7; for( i = 1;i<= 10;i++) { printf("%d",n); if(n%2==0) n
= n / 2; else n=n*3+1; } getch(); } |
viii. 1,2,4,7,11…..upto 13th
terms. #include<stdio.h> #inclue<conio.h> void
main() { int i
,n=1; for( i = 1;i<= 10;i++) { printf("%d",n); n=n+i; } getch(); } |
25.Program to display
the following patterns.
|
i. 1234 1234 1234 1234 #include<stdio.h> #inclue<conio.h> void
main() { int i, j; for (i=1;i!=4;i++) { for(j=1;j!=4;j++) { printf("%d",j); } } getch(); } |
ii. 1 22 333 4444 55555 #include<stdio.h> #inclue<conio.h> void
main() { int i, j; for (i=1;i!=4;i++) { for(j=1;j!=i;j--) { printf("%d",i); } } getch(); |
}
iii. 54321
5432 543 54
5
#include<stdio.h> #inclue<conio.h> void main()
{
int i, j;
for (i=1;i!=5;i++)
{
for(j=5;j!=i;j--)
{
printf("%d",j);
}
}
getch();
}
26.Explain one and two dimensional array with suitable
example.
Ans: A
one-dimensional array is the simplest form of an array in which the elements
are stored linearly
and can be accessed individually by specifying the index value of each element stored in the array.Example:a[4]="ram".
A two dimensional array, has a type
such as int[ ][ ] or String[
][ ], with two pairs of square brackets in which first
square bracket indicates rows and the second one inicates the columns.
|
27.Program to find greatest
and lowest number
among 20 different
numbers.
#include<stdio.h> #include<conio.h> void
main()
{
int a[50],i,large,small; printf("Enter the Array:"); for(i=0;i<20;++i)
{
scanf("%d",&a[i]);
}
large=small=a[0]; for(i=1;i<20;++i)
{
if(a[i]>large)
{
large=a[i];
}
if(a[i]<small)
{
small=a[i];
}
}
printf("The largest element
is %d",large); printf("\nThe
smallest element is %d",small); getch();
}
#include<stdio.h> #include<conio.h> void
main ()
{
int i,j,a,number[50]
printf ("\nPlease enter the numbers
to be sorted as ascending order"); for (i=0; i<15; ++i)
{
scanf ("%d",&number[i]);
}
for (i=0; i<15; ++i)
{
for (j=i+1; j<15;
++j)
{
if (number[i] > number[j])
{
a= number[i]; number[i]
= number[j]; number[j] = a;
}
}
}
printf ("\nAscending order of entered
numbers"); for (i=0; i<n; ++i)
{
printf ("\n%d",number[i]);
}
getch();
}
29.Explain string handling functions.
[strlen(),strupr(),strlwr(),strrev(), strcpy(),strcmp(),
and strcat()] with examples.
Ans: There are various string
functions which we can use in C Language. We need to include header file <string.h> in our program to use
these functions in our program.
Various string functions in c language
are explained below:
· strcpy()
The string
strcpy() stands for string copy. This function is used to copy value of one string variable or string constant
in another string variable. The header file
required for this function is “string.h”.
Example∷
#include<stdio.h> #include<string.h> void main()
{
char name[20],a[20]="Amit"; strcpy(name,a);
printf(“\nname=%s”,name);
getch();
}
· strcat()
∷ The
function strcat() stands for string concatination. This function is used to combine values of two string variables
together.The header file required for this function
is “string.h”.
Examples:
#include<stdio.h> #include<string.h> void
main()
{
char name[20]=”Gautam”,caste[20]="Biswhakarma";
strcat(name,caste);
printf(“\nname=%s”,name);}
·
strlen()
The function strlen() stands for
string length. This function is used to find number of characters stored in a string variable or string constant.
This function doesn’t count null
character. The header file required
for this function is “string.h”.
Example:
#include<stdio.h> #include<string.h> void
main()
{
char studentname[20]=”Amit”;
int n; n=strlen(studentname);
printf(“\nNumber of characters=%d”,n);
}
·
strrev()
The function
strrev() stands for string reverse. This function is used to reverse the order
of characters stored
in a string variable.
Example::
#include<stdio.h> #include<string.h> void
main()
{
char a[20]=”Amit”;
strrev(a);
printf(“\nStudentname=%s”,a);
getch();
}
· strcmp()
∷This
fumction stands for string compare.
This function is used to compare
value of one string value with another string value. The header file required for this function is “string.h”.
Example∷#include<stdio.h>
#include<string.h> void
main()
{
char a[25];
strcmp(a,”Amita”);
if(strcmp(a,”Amita”)= =0)
printf("\nWelcome”); else
printf(”\nBye”);
getch();
}
· strlwr()
∷This
function stands for string lower. This function is used to convert
the uppercase letters
in the string to lowercase letters.
Example∷#include<stdio.h>
#include<string.h> void main()
{
char a[20]=”AMIT”;
strlwr(a);
printf(“\nlower case of input string
is %s”,a);}
· strupr()
∷ The
function strupr() stands for string upper. This function is used to convert the small case letters in the string to uppercase
letters.
Example∷#include<stdio.h>
#include<string.h> void
main(){
char a[20]=”amit”;
strupr(a);
printf(“\nuppercase of input
string is %s”,a);}


0 comments:
Post a Comment
Thanks for Your Comment.