You are on page 1of 3

9017

0708-II
3 Hours / 80 Marks Seat No.

Q.1 Attempt any EIGHT of the following 16


a) Explain function definition. Give syntax for function.
b) What is variable declaration and variable initialization?
c) Define call by value.
d) What is array? How it is declared?
e) What are the uses of printf( ) and scanf( )?
f) What is pointer? Give its declaration.
g) Give general form of structure and define a structure student having
member variables as roll_no, name and dob.
h) What is difference between while and do-while?
i) State use and syntax of strcat( ) function.
j) Describe nested if-else statement.

Q.2 Attempt any THREE of the following: 12


a) Write a program to display table up to 30. Use for loop.
b) Write the output of following program. Take suitable input.
#include<stdio.h>
void large( )
{
int a,b;
printf(“Enter values of a and b :”);
scanf(“%d %d”,&a,&b);
if(a<b)
printf(“large : %d”,b);
else
printf(large : %d”,a);
}
main( )
{
large( );
large( );
}
c) Give any four forms of nested if-else statement.
d) List different relational and logical operators. What will be the output of
following program?
#include<stdio.h>
void main( )
{
float a = 5, b = 2;
-1- CPR – (S’2008)
int c;
c = a % b;
printf(“%d”,c);
}

Q.3 Attempt any THREE of the following: 12


a) Explain switch statement with suitable example.
b) State use of %c %d and %f.
Write output of following:
#include<stdio.h>
main( )
{
float y = 123.456;
printf(“%f %.3f %.1f \n\n”, y, y, y);
}
c) Write a simple program for accessing the data through pointer variable.
d) Explain representation of two dimensional array with example.

Q.4 Attempt any FOUR of the following: 16


a) Two numbers are input through keyboard into two locations C and D.
Write a program to interchange the contents of C and D.
b) What will be the output of the following program?
#include<stdio.h>
void main( )
{
int i = 3; int * j;
j = &i;
printf(“\n Address of i = %u”, &i);
printf(“\n Address of i = %u”, j);
printf(“\n Address of j = %u”, &j);
printf(“\n value of j = %u”, j);
printf(“\n value of i = %d”, i);
printf(“\n value of i = %d”, *(&i));
printf(“\n value of i = %d”, *j);
}
c) Explain strcmp( ) function in detail.
d) Write a program for exchanging values of two variables using call by
reference.
e) Using while loop, write a program to print all Armstrong numbers between 1
and 500. If sum of cubes of each digit of the numbers is equal to the
number itself, then number is called Armstrong number.
For example: 153 = (1*1*1) + (5*5*5) + (3*3*3)
f) Write a program to copy contents of one array into another array.

Q.5 Attempt any THREE of the following: 12


a) Define the following:
1) Keyword

-2- CPR – (S’2008)


2) Variable.
3) Data types
4) Constants.
b) State use of continue statement over break statement using suitable
example.
c) Write a program to print first 10 odd numbers using while loop.
d) Define two structures date and account.
Date has members: day, month, year
Account has members as: acc_no, balance, dob
Assign initial values to them.

Q.5 Attempt any THREE of the following: 12


a) Write a program which will print largest of three numbers using if-else
b) Declare a structure ‘Book’ having data members title, author and price.
Accept this data for one variable and display accepted result.
c) Explain concept of pointer arithmetic operations.
d) Explain how array elements are accessed by using pointers.

-3- CPR – (S’2008)

You might also like