How To Exam?

a knowledge trading engine...


Sardar Patel University 2007 B.E Computer Science PC208 – Computer Application & Programming(Internal ) - Question Paper

Tuesday, 29 January 2013 10:20Web

ADIT/ GCET
A.Y. 2006-2007 -- II Semester
PC208 – Computer Application & Programming
1st Internal examination -- Solution

Q :1
a) It is 1 of the system software.
It converts & translates 1 form of computer language into a different form.
Categories:
(a) Translator: software which converts 1 form of computer language into a different form.




(b) Assembler: It is software which translates an assembly language into a machine code. It is low level language processor.




(c) Compiler: It is high level language processor. It converts a program written in high level language into machine code (object program).
It detects all syntax errors of a program at a time so it
is very fast but also requires a large memory.






(d) Interpreter: It’s an option to compiler. It converts a program written in high level language into machine code (object program) line by line.
So it takes more time than compiler & also requires less
memory than compiler

b) Character Printer:
Character Printer prints only 1 character at a time. Whenever printing requirements are not large, it is used on computers of all sizes.
Examples:
Dot matrix printer
Thermal dot matrix printer
Daisy wheel printer
Inkjet printer

Inkjet Printer:
It sprays small drops of ink on paper to form printed characters. This ink has a high iron content which is affected by magnetic field of the printer.
This magnetic field causes the ink to form the shape of a character.
Characteristics:
Non-impact kind printer
Doesn’t make noise while printing
Produces high quality output
Can form any type of character
Enable to take multiple color printing

OR

It is also known as casting a value. Sometimes there are times when we want to force a kind conversion which differs from automatic kind conversion.
i.e. It is not implicitly given by C language but user has to do it by its own (explicitly) to get desired outcome.
Syntax:
(type-name) expression
Where type-name is 1 of the standard C data kinds & expression may be a constant, variable or an expression.

Example:
If we want to compute avg. of three integer numbers then probably avg. should be in float but if we do like this
avg = (a+b+c)/3
then ans is also integer value instead of float value which we want. So convert locally 1 of the variables to the floating point.
avg = (float)(a+b+c)/3 or avg = (a+b+c)/3.0

c) Column A Column B
Random Access Memory Temporary Storage
learn Only Memory Permanent Storage
Erasable Programmable ROM Ultraviolet Light
Electrically Erasable Programmable ROM Electrical Mechanism

Q:2
a) #define statement is used to describe symbolic constant.
Syntax:
#define symbolic-name value-of-constant
subsequent are the 2 reasons why it is useful.
(i) Modification of the program becomes easier.
(ii) Understanding of the program becomes easier.
Examples:
#define PI 3.14159
#define MAX 500
#define TOTAL 50

b) (i) Error: In single declaration statement semicolon comes
only once. So comma must be there after b=12
Output:
5
(ii) Error: While defining symbolic constant, = & ; don’t
come.
Output:
28.260000
Q:3
a) #include
#include
void main()
{
int r,i,j,sum=0,sum_s;
long int no;
clrscr();
printf("enter any integer number:\n");
scanf("%ld",&no);
while(no!=0)
{
r=no%10;
no=no/10;
sum=sum+r;
}
i=sum%10;
sum=sum/10;
sum_s=i+sum;
printf("sum upto single digit is = %d",sum_s);
getch();
}

b) #include
#include
void main()
{
int i,j,n;
clrscr();
printf("enter value for n:\n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("%d ",i);
}
printf("\n");
}
getch();
}


------------O-----------





( 0 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER Sardar Patel University 2007 B.E Computer Science PC208 – Computer Application & Programming(Internal ) - Question Paper