Guess Paper of
C-Language of Jan-2021/July-2021
1.
Guess Paper of
C-Language of Jan-2021
- Fibonacci series
- Storage classes available
- Pointer, Function, file handling
- What are the advantages and disadvantages of an Array
- Write a 'C' program to copy text of one file to another file.
- What is command line argument?
- What are preprocessor directives? Why do we need them? Explain various preprocessor directives? Explain the difference between Text Mode and Binary Mode files.
- Write a ‘C’ program to find the frequency of characters in a String.
- Write a ‘C’ program to store information (title, author, subject and book_id) of a Book using structure and display it in appropriate format.
- Write a ‘C’ program to find largest element of an Array.
- Write a ‘C’ program to display following pattern:
- A
- B B
- C C C
- D D D D
- E E E E E
- Write a 'C' program that displays the recommended actions depending on the color of a traffic light using the switch statement.
- What is function? Explain uses of function. Also, explain declaration, function call and function definition with example.
- Write a ‘C’ program to swap two variables without using third variable.
- What are merits and demerits of array in ‘C’?
- Write a ‘C’ program in which a scanf() function can read a complete paragraph of text.
- What is difference between pass by value and pass by reference?
- Write a function in ‘C’ to print even numbers from 1 to 100.
- Write a ‘C’ program to find whether a number is palindrome or not.
- Write a program to reverse an array of numbers. b) Define array and link list. Give one example for each showing its usage. c) Write a program to delete an element from a given location of an array of integers
- Write a ‘C’ Program to find Sum of lower triangular elements in a matrix.
- Write a ‘C’ Program to find substring of string without using Library Function.
- How can you create your own header file in ‘C’ programming? Briefly explain.
- Write down three different methods used for referencing multiple values from a function.
- Write a ‘C’ program to read following details of 50 students. Student Name, Student Roll No, Class Display total number of students studying in class “BCA”.
- Write two main differences between structure and union.
- Compare the use of switch statements with the use of nested if statements. Which is more convenient ? Explain break, continue and goto statements with example.
- Write a program to print all prime numbers from 1 to 100. Use nested loops, break or continue statement wherever necessary.
- Explain the difference between = and = = operator with example. (b) What will be the output of the following program segment?
- main( ) { int x=3,y=5;
- if(x= =3)
- printf(“\n%d”,x);
- else; printf(“\n%d”,y);
- }
- Write a program to find the sum of the digits of a number.
- What is call by value and call by reference ? Write a program to swap two numbers using call by value. What do you understand by local, global and static variables ? Explain.
- Compare the lifetime, Scope, Initial value and storage place of all storage classes.
- Write a program to add a new node to the beginning of a linked list and to the end of linked list.
- What is a file in C ? Discuss various modes in which a file can be opened. Also discuss types of files.
- Write a note on pointers and its uses. What do you mean by referencing and de-referencing of a pointer variable ? (b) Explain any five string handling functions in detail with example. (c) Write a program to reverse an array.
- Write a function fnpow() in C to compute xy where x is float and y is integer. Function will return the result and takes x, y as arguments
- Write a function fnmat() which takes matrix, m, n as arguments where matrix is of size mXn with m as rows and n as columns. Function should return the maximum and minimum elements of the matrix. Elements of matrix are of integer type.
- Find the output of the following:
- char p[] = "%d\n";
- p[1] = 'c'; printf(p, 65);
- int k=40, *a; a=&k; (*a)++; k++;
- printf(“\n k=%d”,k);
- Write a program using command line parameters to append one text file to another text file.
- Write down one similarity and one dissimilarity between break and continue statements.
- A programmer wants to use two variables session and info. Variable session can take three values (morning, afternoon, evening) only. Using variable info, the programmer wants to access information empname and empid of 30 employees. Name the appropriate data type used for each variable session and info and declare the variables.
- Given array a[10][10] of integer where each integer takes 4 bytes. Given the base address of array a as 4000, find address of a[4][5] assuming array is stored as row-major order.
- Write a file statement to place a file pointer (fp) at the beginning of the record number (say R), where record size is B bytes.
- Differentiate between struct and union. When is union preferred over struct? Give one example for each.
- Explain differences between:
- Text file and binary file
- static and extern storage class
- b) Write down the objective of following function:
- void f1(char s[], char c)
- {int i ,j ;
- for(i=j=0; s[i] != `\0’; i++)
- if (s[i]!=c) s[j++]=s[i];
- s[ j ] = `\0’;
- return;
- }
- c) Explain the meaning of following declarations:
- int *p(char *a[])
- int *p(char *a, char *b)
- int (*p) (char *a)[] (++)
- Write a program that accept an array of 10 integers and a number to be deleted from the array if found. Represent deleted element with -1 and display final array. If not found print appropriate message.
- Explain the role of linker and loader in compilation.
- Explain the relation of array and pointer with example.
- Draw a flow chart to print the factorials of numbers from 1 to n where n is entered by user.
- Write a function to display the multiplication table of the number.
- Write a function which accepts an array of size n containing integer values and returns average of all values. Call the function from main program.
- Using a switch statement, write a function to count the number of vowels and number of blanks in a character array passed to it as an argument.
- Which are the demerits of linked list data structure?
- Explain working of bit-wise exclusive OR and shift left operators in C with example.
- Write a program to find greatest number in an array?
- Explain the concept of recursion with example.
- Explain the difference between Test mode and Binary mode files.
- For example, 145 = 1! + 4! + 5! = 1 + 24+ 120 = 145.
- Define a structure Distance having two data members: cm and mm in integer. The program enters three variables and find which distance is the largest among them.