Sample paper of C language

Mar 15 • General • 2708 Views • 6 Comments on Sample paper of C language

Maximum Marks=100

Time taken=3 hours

Instructions : Attempt any Five questions selecting atleast one from each unit. All questions carry twenty marks each.


C language

C language

Unit 1

Q.1 What is C language? Explain its history in brief and the reasons for its popularization.

Ans : C is a programming language developed by AT and T’s Bell Laboratories of USA in 1972 by Dennis Ritchie.The language is popular as it is reliable,simple and easy to use.

Q.2 Explain the various types of C instructions and in context to it explain the while statement.

Ans :The various types of C instructions are type declaration instructions,arithmetic instructions and control instructions.

While statement syntax:

count=1

while(count<=3)

{body of statement}

count=count+1

Thus here we can see that the program executes all statements after while 3 times and initially count contains the value 1.The logic of programme is written within the body of statement.The parentheses after while contains a condition and as long as it remains true all statements within the body of while loop keep executing.

 

Unit 2

Q.3 What is a function?Specify the things to be kept in mind while writing a program containing functions.

Ans : A function is a self contained block of statements that perform a coherent task of some kind.When we write the programme using function the action of main() is temporarily suspended and control falls to calling programme to execute its block of statements.

While writing programmes using functions one must take care that the information is conveyed to the argument.Accordingly we have two types of arguments-formal arguments and actual arguments.So while writing programs one must be aware of the values being passed among the variables.

Q.4 Explain the concept of arrays with an example.

Ans : An array is a collection of similar elements.These elements could be all ints,or all floats, or all chars.Usually an array of of characters is called a string while an array of ints or floats is simply called an array.Given below is an example of int array.

int array example

int array example

 

Unit 3

Q.5 List the various file operations and give detailed description on any one of them.

Ans : The file operations are-Creation of new file,opening of file,reading from file,writing to file,closing a file.

Explaination of the file operation of opening a file:

Firstly the file to be opened is searched on disk.Then it is loaded from disk to memory and finally a character pointer is set up pointing to the first character of buffer.

Q.6 (a) What do you mean by standard I/O devices?

      (b) Briefly explain redirection.

Ans :To perform reading or writing operations on a file we need to use a function fopen().This sets up a file pointer to refer to this file.

Most operating systems incorporate a powerful feature that allows a program to read and write files and this is done through the process of redirection.

 

Unit 4

Q.7 (a) Name 3 string functions.

(b) Explain each function with examples.

Ans: (a) The various string functions are strlen, strlwr and strupr.

 (b) Strlen – Finds length of string, Strlwr-converts a string into lowercase, strupr-converts a           string into uppercase.

Q.8 Why are structures used so extensively in C language?

Ans : A structure contains a number of data types grouped together.These data types may or may not be of the same type.It is due to this feature of structure that it is used extensively in C language.

 

 

 

 

 

 

 

Tell us Your Queries, Suggestions and Feedback

Your email address will not be published.

6 Responses to Sample paper of C language

  1. Deepshikha Bisaria says:

    As we all know, C is the basic programming language. Before learning any other programming language one must know all the concepts of C in detail. C was invented by Denis Ritchie. And here we have solved sample paper of C language i.e. theoretical paper. A very good initiative and very effective paper.

  2. SHRUTI PRIYA says:

    C is the fundamental language of all the languages… Good collection of question.!!! INFORMATIVE!!!!!

  3. Chandreyee Ghosh says:

    C is a basic programming language and a proper concept of C is really needed to know programming in depth. This sample paper is mainly focusing in very primary and mandatory topics . So,this questions can be very helpful for a beginner.

  4. avinash kumar singh says:

    c- programming is a fundamental knowledge every student should know abt programming

  5. Jishnu Sen says:

    C is not a commercially used programming language but it is the basic language to learn the programming from basic.

  6. patlakshi Jha says:

    C is one of the most fundamental language which one must learn in order to understand the basics of programming. So here are the few important sample questions of c which can clear the doubts .

« »