Você está na página 1de 2

Part A (10 * 2 = 20 Marks) (iv) Write a C program to search an element in a

1. Convert the binary number to octal. given array.


2. Define pseudo code. 14. (i) What is a function in C? Discuss about Call by
3. Define algorithm value and Call by reference with illustrations.
4. List different data types available in C.
5. Draw the structure of C program.
6. What is the purpose of keywords? (ii) Write a C program to find factorial using
7. Define string. How to declare and initialize a string? recursion.
8. Define array. Write a code to declare two (iii) Write a program using pointers to read an
dimensional array. array of integers and print the elements in reverse
9. Write any four string handling functions. order.
10. Compare pass by value and pass by reference. 15. (i)Define a structure called book with book name,
11. Define pointer.
12. Define recursion. author name and price. Write a program to read the
13. What are storage classes in C? details of book name, author name and price of 200
14. Write any two preprocessor directive. books in a library and display total cost of the books
15. Differentiate Structure and Union. and the book details whose book price is above
PART B (5 * 16 = 80 Marks) Rs.500.
11. (i) Discuss about generation of computer. (ii) Explain the various storage classes in C.
(ii) Explain the basic organization of c computer. (iii) Explain briefly about C preprocessor directives.
(iii) Convert the decimal number --- into binary,
octal and hexadecimal equivalent.
(iv) Draw a flow chart for finding the biggest of two
numbers.
12. (i) Explain the different types of operator available
in C.
(ii) What are constants. Explain various types of
constants available in C.
(iii) Describe various branching statements
available in C. (iv) Write a program to solve
quadratic equation.
13. (i) Write a C program to multiply two matrices.
(ii) Write a C program for sorting an array of
numbers.
(iii) Explain the various string operations.
{
int n,i,total=0;
struct book b[10];
clrscr();
Pointer Program printf("enter the number of books");
#include<stdio.h> scanf("%d",&n);
#include<conio.h> for(i=0;i<n;i++)
void main() {
{ printf("Enter the book name");
int size, i, arr[20],*ptr; scanf("%s",b[i].bookname);
ptr = &arr[0]; printf("Enter the author name:");
printf("\nEnter the size of array : "); scanf("%s",b[i].authorname);
scanf("%d", &size); printf("Enter the price:");
printf("\nEnter the integers: "); scanf("%d",&b[i].price);
for (i = 0; i < size; i++) }
{ printf("The details of the books \n");
scanf("%d", ptr); printf("\n Book Name \t Author Name "\t Price
ptr++; \n");
} for(i=0; i<n; i++)
ptr = &arr[size - 1]; {
printf("\nElements of array in reverse order are :"); if(b[i].price>500)
for (i = size - 1; i >= 0; i--) {
{ printf("\n%s\t%s\t
printf("\nElement%d is %d : ", i, *ptr); %d",b[i].bookname,b[i].author
ptr--; name,b[i].price);
} total=total+b[i].price;
getch(); }
} }
getch();
Structure Program }
#include<stdio.h>
#include<conio.h>
struct book
{
char bookname[10][10], authorname[10][10];
int price;
};
void main()

Você também pode gostar