ComputerScience II C Optional
ComputerScience II C Optional
1. i) C language developed by
Peter Norton Floyd
Catherine Ricardo Dennis Ritchie
character string
any number all of them
iii) The library function sqrt( ) , return the square root of x = 1024
512 256
32 64
vi) Comments or remarks can be placed anywhere within a program as long as they are placed
within Delimiters.
viii) In c language of this expression y= 5+3-6*2/3, what will be the arithmetic operation by:
Precedence (i) 5+3 (ii) 3-6 (iii) 6*2 (iv) 2/3
Precedence (i) 6*2 (ii) 2/3 (iii) 5+3 (iv) 3-6
Precedence (i) 2/3 (ii) 6*2 (iii) 5+3 (iv) 3-6
Precedence (i) 3-6 (ii) 5+3 (iii) 2/3 (iv) 6*2
“/n” “\t”
“ %f ” i++
xi) The gets( ) and puts( ) functions offer simple alternatives to use of
a=a+1 a+=1
a=+1 a++
xvi) The function void game1(void); is the example of
xviii) There is a unique function in C/C++ program by where all C/C++ programs start their execution
start( ) begin( )
main( ) output( )
xix) To increase the value of c by one which of the following statement is wrong?
c++; c = c + 1;
c + 1 => c; c += 1
x = 3;
y = x++;
printf(“x=%d and y=%d”,x,y);
do while( ) while( )
repeat – until ( ) for( )
for( ) do-while( )
while( ) goto - loop
Random Sequential
Sequential and Random sequentially gap
for( ) while( )
goto – label_name do – while
void main(void)
{
Int arr[10] = {1,2,3,4,5};
printf(“%d”,arr[5]);
}
Zero (0) 5
6 10
! &&
& &#
printf("\\n"); printf("n\");
printf("n"); printf('\n');
xxxiii) The keyword used to transfer control from a function back to the calling function is
switch goto
go back return
xxxiv) How many choices are possible when using a single if-else statement?
1 2
3 4
NOTE:-Attempt Five question from this section( No Answer Should exceed 6-7 lines).
2. i) What is an IDE? Which two short-keys are used to compile the program?
ii) Define include and header files.
iii) Determine which of the following are valid or invalid identifier, integer constant, character constant,
float (real), constant, string constant and separate them. If invalid give reason?
(a) record1 (b) $tax (c) name and address (d) 27,822
(e) 0.576 (f) 1527 (g) 2e-8 (h) 1,232.5 (i) 5.234
iv) What is the difference between Escape sequences and format specifiers?
v) Write a Program in „C‟ language to use all arithmetic assignment operators.
vi) Name the five basic data types of C-language? Write typical memory requirements and data types
range?
int a=2,b=2;
if(a!=0)
b=0;
else
b*=10;
printf("%d",b);
viii) What are Local and Global Variables also write both examples?
ix) Write the Syntax of Function definition, calling Function and Prototype Function in C.
x) Define an array. How to declare Array in C? Give two examples.
4. How many types are Loops in C-programming language? Show syntax of each loop?
OR
Write C Program to arrange any ten numbers in ascending order by using an array.
6. Convert the following program segment of if-else statement into Switch – Case Statement.
Scanf(“%d”,&condition);
if(condition==1)
printf(“ Red colour”);
else if(condition==2)
printf(“ Black Colour”);
else if(condition==3)
printf(“ White Colour”);
else
printf(“ No Colour”)