Tuesday, November 16, 2010

C Objective Sample Paper

C Questions

1.What is the output of the following program-
void main()
{
extern int i;
i=20;
printf(“%d”,sizeof(i));
}
a)2                                b)4
c)vary from compiler to compiler   d)error,i undefined


2.What is the output of the following-
void main(){
int x=10,y=20,z=5,i;
i=x<y<z;
printf(“%d”,i);
}
a)0                               b)1
c)Error                          d)none of the above


3.What is the output of the following-
void main(){
enum status{pass,fail,atkt};
enum status stud1,stud2,stud3;
stud1=pass;
stud2= atkt;
stud3=fail;
printf(“%d %d %d”,stud1,stud2,stud3);
}
a)012          b)123
c)021          d)132

4. What is the output of the following-
void main(){
int k,num=30;
k=num>5?num<=10?100:200:500;
printf(“%d”,num);
}
a)200          b)30
c)100          d)500

5. What is the output of the following-
void main(){
float a=0.7;
if(a<0.7)
printf(“C”);
printf(“C++”);
}
a)C                     b)C++
d)Error                 d)none

6. What is the output of the following-
void main()
{               printf(“%d%d%d”,sizeof(3.14f),sizeof(3.14),sizeof(3.14L));
}
a)4 4 4                    b)4 8 8
c)4 8 10                  d)4 8 12

7.What will be the value of i for the following expression-
int i=3,f=11;
i+=(f>3)?i&2:5;
a)2                   b)5
c)13                  d)12

8.int arr[]={1,2,3,4}
int count;
incr(){return ++count;}
main()
{
arr[count++]=incr();
printf(“arr[count]=%d”,arr[count]);
}
a)1                       b)2
c)3                       d)4

9. What will be output when you will execute following c code?
#include<stdio.h>
void main(){
char *str="ONE"
str++;
switch(str){
case "ONE":printf("ONE");
break;
case "NE": printf("NE");
break;
case "N":  printf("N");
break;
case "E":  printf("E");
}
}
a)ONE                          b)NE
c)N                            d)E

10.What is the output?
main(){
inc();inc();inc();
}
inc(){
static int x;
printf(“%d”,++x);
}
a)012                 b)123
c)3 consecutively     d)111

11.Preprocessing is typically done
a)either before or at the beginning of compilation process.
b)after compilation but before execution
c)after loading
d)none of the above.

12.The statement printf(“%d”,10?0?5:11:12);
prints
a)10     b)0
c)12     d)11

13.The statement printf(“%d”,sizeof(“”));prints
a)an error message   b)0
c)garbage            d)1

14.calloc(m,n); is equivalent to
a)malloc(m*n,0);
b)memset(0,m*n);
c)ptr=malloc(m*n);memset(p,0,m*n);
d)ptr=malloc(m*n);strcpy(p,0);

15.Which of the following comment about union is not true?
a)Union is a structure whose members share the same storage area.
b)The compiler will keep track of what type of information is currently stored.
c)Only one of the members of the union can be assigned a value at a particular time.
d)Size allocate for union is the size of its members needing the maximum storage.

16.Consider the following program segment-
char *a,*b,c[20],d[20];
a=b;
b=c;
c=d;
d=a;
Choose the statements having errors-
a)no error         b)a=b;b=c;
c)c=d;d=a;          d)a=b;d=a;

17.The output of the following program
main(){
int a=1,b=2,c=3;
printf(“%d”,a+=(a+=3,5,a));
}
a)8     b)12
c)9     d)6

18.The declaration int(*p)[5];
Means
a)p is one dimensional array of size 5,of pointers to integers
b)p is a pointer to a 5 element integer array
c)the same as int *p[5];
d)none.

19.What will be the output of the following program if its executed from the command line as follows
Myprog one two three
void main(int argc,char *argv[])
int i;
for(i=1;i<=3;i++)
printf(“%c”,*argv[i]);
}
a)one two three          b)ott
c)Myprog one two         c)none

20. What will be the output of the following program if its executed from the command line as follows
Myprog 1 2 3
void main(int argc,char*argv[])
{
int j;
j=argv[1]+argv[2]+argv[3];
printf(“%d”,j);
}
a)6                b)runtime error
c)compiler error   d)123

21.printf(“%d”,printf(“game”));
a)results in a syntax error
b)outputs game4
c)outputs garbage
d)prints game and terminates abruptly.

22.If abc is the input,then the following program fragment
Char x,y,z;
Printf(“%d”,scanf(“%c %c %c”,&x,&y,&z));results in
a)a syntax error         b)a fatal error
c)segmentation violation d)printing of 3

Wednesday, June 30, 2010

June 2010 paper 3

Section-A(Elective)-40 marks
TOC-
Q.1
a)Design a TM for a^nb^n c^n.
b)NFA for
    -strings (0,1) with 1 at even places
    -with substrings 000 and 010

Q.2.What is the difference between bit rate and baud rate?For manchester encoding what is the baud rate for 1 mbps?
Given a complete binary tree its inorder is given ACGHBDE.., Find the preorder and postorder.
  OR
Given the relations and Functional dependency,if its decomposed into other relations.Is the dependency preserved and is it lossless?
Given the memory size what is first fit,best fit and worst fit

Section-b(Elective)-Essay Type
Section-C
 Each question carries 10 marks-

 Q.1.What is the role of entities in XML?What are the different types of entities in XML?

 Answer: Entities are variables used to define shortcuts to standard text or special characters.They can be thought of as macros or aliases. 
When you use the entity name elsewhere within a DTD, or in an XML document, language parsers replace the name with the corresponding characters.This helps you avoid typing name everytime.
There are three different types  of entities in XML-
a)Internal Entity:-
   <!Entity UGC "University grant commission">
  The replacement text is stored in the declaration itself.To use this entity you insert an entity reference in your document "&UGC;"
b)External entity:-
   <!Entity course SYSTEM "/standard/course.xml">
   when the replacement text is long then it is placed in some other file.External entities allow an XML document to refer to an external file.They contain either text or binary data(as images).
c)Parameter entity:-is used for shortcuts within the DTD
   <!Entity %name "replacement text">
these entities are identified by placing % instead of &,also for refering " % "is used.
eg
<!ENTITY book "UGC NET: BPB, &#xA9; 1947 %pub; &rights;">

Q.2.Write the function of 8:1 multiplexer for (0,3,4,6,8,9,12,14)
Q.3.Draw a conceptual dependency graph for the statement "Smoking kills...."
Q.4.On what basis does the window make a selection whether a line will be clipped,displayed or discarded.
given the window has bottom  right at (200,50) and top left given and the line points given?
Q.5.For a college an attendence sheet has to be maintained.Which data structure will you use?How would your choice change in the following conditions-
a)the students are 50 to 1000 only in number
b)the students are 10,000 to 50,000 and data is to be maintained centrally.
c)the students are 10,000 to 50,000 and data is to be distributed.
Q.6.Explain with example that Quick Sort is divide and conquer.
Q.7.What are the factors that determine the cost of software maintenance.

Section-D

Given some paragraph-
a)Draw Use case diagram
b)draw Class diagram
c)draw Sequence Diagram
d)draw state diagram
e)draw activity diagram

Monday, June 7, 2010

TOC Sample Paper

Q. Write a r.e to denote a language L which accepts all the strings which begin or end with either 00 or 11.

Ans:
The r.e consists of two parts:
L1=(00+11) (any no of 0’s and 1’s)
=(00+11)(0+1)*
L2=(any no of 0’s and 1’s)(00+11)
=(0+1)*(00+11)
Hence r.e R=L1+L2
=[(00+11)(0+1)*] + [(0+1)* (00+11)]

Q.Construct a r.e for the language which accepts all strings with atleast two c’s over
the set ={c,b}

Ans:
(b+c)* c (b+c)* c (b+c)*

Q.Construct a r.e for the language over the set ={a,b} in which total number of
a’s are divisible by 3

Ans:
( b* a b* a b* a b*)*

Q.what is:
(i) (0+1)*
(ii)(01)*
(iii)(0+1)
(iv)(0+1)+

Ans:
(0+1)*= { , 0 , 1 , 01 , 10 ,001 ,101 ,101001,…………………}
Any combinations of 0’s and 1’s.

(01)*={ , 01 ,0101 ,010101 ,…………………………………..}
All combinations with the pattern 01.

(0+1)= 0 or 1,No other possibilities.

(0+1)+= {0,1,01,10,1000,0101,………………………………….}

Q.Reg exp denoting a language over ={1} having
(i)even length of string (ii)odd length of a string
Ans:
(i) Even length of string R=(11)*
(ii) Odd length of the string R=1(11)*

Q.Reg exp for:
(i)All strings over {0,1} with the substring ‘0101’
(ii)All strings beginning with ’11 ‘ and ending with ‘ab’
(iii)Set of all strings over {a,b}with 3 consecutive b’s.
(iv)Set of all strings that end with ‘1’and has no substring ‘00’

Ans:
(i)(0+1)* 0101(0+1)*
(ii)11(1+a+b)* ab
(iii)(a+b)* bbb (a+b)*
(iv)(1+01)* (10+11)* 1

Q. Reg exp for the language such that every string will have atleast one ‘a’ followed
by atleast one ‘b’.

Ans: R=a+b+

Q. What are the applications of pumping lemma?
Ans:
Pumping lemma is used to check if a language is regular or not.
(i) Assume that the language(L) is regular.
(ii) Select a constant ‘n’.
(iii) Select a string(z) in L, such that |z|>n.
(iv) Split the word z into u,v and w such that |uv|<=n and |v|>=1.
(v) You achieve a contradiction to pumping lemma that there exists an ‘i’
Such that uviw is not in L.Then L is not a regular language.

Q. Find the grammar for the language L={a2n bc ,where n>1 }

Ans:
let G=( {S,A,B}, {a,b,c} ,P , {S} ) where P:
S->Abc
A->aaA |

Q. 16.Find the language generated by :
S->0S1 | 0A | 0 |1B | 1
A->0A | 0 , B->1B | 1

Ans:
The minimum string is S-> 0 | 1
S->0S1=>001
S->0S1=>011
S->0S1=>00S11=>000S111=>0000A111=>00000111
Thus L={ 0n 1 m | m not equal to n, and n,m >=1}

Q.Construct the grammar for the language L={ an b an | n>=1}.

Ans: The grammar has the production P as:
S->aAa
A->aAa | b
The grammar is thus : G=( {S,A} ,{a,b} ,P,S)

Q. Construct a grammar for the language L which has all the strings which are all
palindrome over ={a, b}.

Ans:
G=({S}, {a,b} , P, S )
P:{ S -> aSa ,
S-> b S b,
S-> a,
S->b,
S-> } which is in palindrome.

Q. Let G= ( {S,C} ,{a,b},P,S) where P consists of S->aCa , C->aCa |b. Find L(G).

Ans:
S-> aCa => aba
S->aCa=> a aCa a=>aabaa
S->aCa=> a aCa a=> a a aCa a a =>aaabaaa
Thus L(G)= { anban ,where n>=1 }

Q. Find L(G) where G= ( {S} ,{0,1}, {S->0S1 ,S-> },S )

Ans :
S-> , is in L(G)
S-> 0S1 =>0 1=>01
S->0S1=>0 0S11=>0011
Thus L(G)= { 0n1n | n>=0}

TOC Sample Paper MCQ

Que. 1 Given the following expression grammar:

E->E * F | F+E | F
F-> F-F | id

Which of the following is true?
A * has higher precedence than +
B - has higher precedence than *
C + and - have same precedence
D + has higher precedence than *

Que. 2 Consider the following two statements:

S1: {(O^2n) |n>/=1} is a regu1ar language
S2: {(O^m)(1^n)(O^m+n)|m>/=l and n>/=l} is a regu1ar language

Which of the following statements is correct?
A Only S1 is correct
B Only S2 is correct
C Both S1 and S2 are correct
D None of S1 andS2 is correct

Que. 3 Which of the following statements in true?

A If a language is context free it can always be accepted by a deterministic
push-down automaton
B The union of two context free languages is context free
C The intersection of two context free languages is context free
D The complement of a context free language is context free

Que. 4 Which of the following statements is false?

A An unambiguous grammar has same leftmost and rightmost derivation
B An LL(1) parser is a top-down parser
C LALR is more powerful than SLR
D An ambiguous grammar can never be LR(k) for any k

Que. 5 Consider the following languages:

L1={w w l w (belongs) to) {a,b}*}
L2={ww^R | w (belongs) {a, b}*, w R is the reverse of w}
L3 = { 0^2i | i is an integer}
L4 = {[(O)^i]^2| i is an integer}

Which of the languages are regular?
A Only L1 and L2
B Only L2, L3, and L4
C Only L3 and L4
D Only L3

Que. 6 Context free language are closed under

A union, intesection
B union,kleene closure
C intesection,complement
D complement,kleene closure


Que. 7 Context free languages are

A closed under union
B closed under complementation
C closed under intersection
D all of the above

Que. 8 Which one is equivalent (i) (00)*(e+0) (ii) (00)* (iii) 0* (iv)
0(00)*

A (i) and (ii)
B (ii) and (iii)
C (i) and (iii)
D (iii) and (iv)

Que. 9 Type O grammer is

A (C)both and (b) above
B (C)both (a) and above
C both (a) and (b) above
D none of these

Que. 10 Consider a DFA over S = {a, b} accepting all strings which have number of a's divisible by 6 and number of b's divisible by 8. What is the minimum number of states that the DFA will have?

A 8
B 14
C 15
D 48

Friday, May 21, 2010

General Notes for paper-1

  • The UGC, was formally established only in November 1956 as a statutory body of the Government of India through an Act of Parliament for the coordination, determination and maintenance of standards of university education in India.
  • National Assessment and Accreditation Council (NAAC) was established by the UGC in September 1994 at Bangalore for evaluating the performance of the Universities and Colleges in the Country.
  • UGC chairman Prof.Sukhadeo Thorat conferred with Mother Teresa Lifetime achievement award 2010
  • An Inter-University Centre of UGC the INFLIBNET(information and Library network) serves towards modernization of Libraries, serves as Information Centre for transfer and access of information, supporting scholarships and learning and academic pursuits through a National Network of Libraries in around 264 Universities, Colleges and R &D Institutions across the country. 
  • Inter University Accelerator Centre was the first Inter-University Centre to be established by the UGC in 1984(formerly nuclear science centre).
  • The UGC has established 4 National Facilities Centre in the selected universities as per details given below:-



    1. Western Regional Instrumentation Centre, Mumbai
    2. M.S.T. Radar Facilities, Sri Venkateshwar University, Tirupati
    3. Inter University Centre for Humanities and Social Sciences IUCHSS, Indian Institute of Advanced Study, Shimla
    4. Crystal Growth Centre, Anna University, Madras 


    NCTE & Intel renewed the MoU on 12th Jan 2010 in a high profile event attended by all the senior officials of NCTE and Intel. Shri Hasib Ahmad Member Secretary from NCTE and Mr.Rahul Bedi  of Intel were the signatories of the MoU.



    Schedules

    Schedules are lists in the Constitution that categorizes and tabulates bureaucratic activity and policy of the Government.
    First Schedule (Articles 1 and 4): States and Union Territories  – This lists the states and territories on of India, lists any changes to their borders and the laws used to make that change.
    Second Schedule (Articles 59, 65, 75, 97, 125, 148, 158, 164, 186 and 221) — Emoluments for High-Level Officials  – This lists the salaries of officials holding public office, judges, and Comptroller and Auditor-General of India.
    Third Schedule (Articles 75, 99, 124, 148, 164, 188 and 219) — Forms of Oaths  – This lists the oaths of offices for elected officials and judges.
    Fourth Schedule (Articles 4 and 80)  – This details the allocation of seats in the Rajya Sabha (the upper house of Parliament) per State or Union Territory.
    Fifth Schedule (Article 244)  – This provides for the administration and control of Scheduled Areas[Note 1] and Scheduled Tribes[Note 2] (areas and tribes needing special protection due to disadvantageous conditions).
    Sixth Schedule (Articles 244 and 275) — Provisions for the administration of tribal areas in Assam.
    Seventh Schedule (Article 246) — The union (central government), state, and concurrent lists of responsibilities.
    Eighth Schedule (Articles 344 and 351) — The official languages.
    Ninth Schedule (Article 31-B) – This covers land and tenure reforms; the accession of Sikkim with India. It may be reviewed by the courts.
    Tenth Schedule (Articles 102 and 191) — “Anti-defection” provisions for Members of Parliament and Members of the State Legislatures.
    Eleventh Schedule (Article 243-G) — Panchayat Raj (rural development).
    Twelfth Schedule (Article 243-W) — Municipalities (urban planning).

    Thursday, April 22, 2010

    Paper -1 Guidance and practice

    Paper 1 has following Topics-


    I.TEACHING APTITUDE(5 questions in the exam)

    This section will have 5  general questions based on teaching aptitude which you can answer easily like-

    1. Which one of the following is the main objective of teaching?
    (A) To give information related to the syllabus.
    (B) To develop thinking power of students.
    (C) To dictate notes to students.
    (D) To prepare students to pass the examination.


    2. Which one of the following is a good method of teaching?
    (A) Lecture and Dictation
    (B) Seminar and Project
    (C) Seminar and Dictation
    (D) Dictation and Assignment

    Answer

    3. Teacher uses teaching aids for
    (A) Making teaching interesting
    (B) Making teaching within understanding level of students
    (C) Making students attentive.
    (D) The sake of its use.

    Answer

    4. Effectiveness of teaching depends on
    (A) Qualification of teacher
    (B) Personality of teacher
    (C) Handwriting of teacher
    (D) Subject understanding of teacher

    Answer

    5. The idea of Basic Education is propounded by—
    (A) Dr. Zakir Hussain
    (B) Dr. Rajendra Prasad
    (C) Mahatma Gandhi
    (D) Rabindranath Tagore


    Answer

    6. The aim of education should be—
    (A) To develop vocational skills in the students
    (B) To develop social awareness in the students
    (C) To prepare the students for examination
    (D) To prepare the students for practical life


    Answer

    7. The ideal teacher—
    (A) Teaches the whole curriculum
    (B) Helps his students in learning
    (C) Is a friend, philosopher and guide
    (D) Maintains good discipline


    Answer

    8. A student comes late in your class. Then you will—
    (A) inform to parents
    (B) punish him
    (C) try to know the reason
    (D) not pay attention there


    Answer

    9. When the students become failed, it can be understood that—
    (A) The system has failed
    (B) The teachers failure
    (C) The text-books failure
    (D) The individual student’s failure


    Answer

     10. The main task of a teacher is—
    (A) to prepare good citizens from his students
    (B) to complete the prescribed syllabus
    (C) to increase knowledge
    (D) to do politics in the school

    Answer

    II.RESEARCH APTITUDE

    A careful,systematic,patient study and investigation in some field of knowledge,undertaken to establish facts or principles is called research.
    RESEARCH may be APPLIED or BASIC

    The purpose of APPLIED research is to solve an immediate,practical problem.
    Basic Research(pure) adds to the existing body of knowledge;doesn't necessarily provide results of immediate,practical use.

                                                     













    Descriptive Research describes,interprets and clarifies a situation or a problem.e.g types of services provided by an organization,how a child feels living in a home with domestic violence.

    Correlational Research is to discover or establish the existence of a relationship/interdependence/association between two or more aspects of a situation e.g what is the impact of advertising campaign on the sale of the product?

    Explanatory research attempts to clarify why and how there is arelationship between between two aspects of a situation or phenomenon.e.g why stressful living results in heart attacks.

    Exploratory research is usually carried out when researcher wants to explore areas about which he has little or no knowledge.

    Qualitative research purpose is to describe a situation,phenomenon,problem or event e.g. an account of different opinions people have about an issue.

    Quantitative research  is if you want to quantify the variation in the phenomenon and analysis is done to ascertain the magnitude of variation.e.g. how many people have a particular problem?How many people hold a particular attitude?

    SAMPLING 

    Read about sampling-
    http://www.socialresearchmethods.net/tutorial/Mugo/tutorial.htm

    III.READING COMPREHENSION


    IV. COMMUNICATION


    Q.1 The competency of an effective communication can be judges on the basis of-
               a)Personality of the communicator.
               b)Experience in the field
               c)Interactivity with the target audience.
               d)Meeting the needs of target audience.

          Answer

    Q.2  Informal communication network within the organization is known as-
            a)Interpersonal Communication
            b)Intrapersonal Communication
            c)Mass Communication
            d)Grapevine communicaion.

         Answer

    Q.3 The science of study of feedback systems in humans,animals and machines is known as -
            a)Cybernetics
            b)Reverse Communication
            c)Selective Study
             d)Response Analysis

      Answer

    Monday, March 29, 2010

    Operating System


    OPERATING SYSTEM

    Download Operating system by Silberschatz,Galvin

    1.Scheduling Algorithms.
    2.Process Synchronization- e.g. Questions on semaphores.
    3.Deadlock-It's prevention ,avoidance and recovery.
    4.Objective questions on Unix commands
    5.Memory Management-Address binding,Memory allocation,Paging,Segmentation etc.
    6.Virtual memory,Demand paging,Page replacement algorithms.
    7.Threads

    What is the difference between paging and segmentation?
    • Programmer is aware of segmentation.Paging is hidden.
    • Segmentation maintains multiple address spaces per process,paging maintains one address space per proccess.
    • Segmentation allows procedures and data to be separately protected.This is hard with paging.
    • Segmentation facilitates sharing of procedures between proccesses.
    • Pure segmentation suffers from memory fragmentation.


    SAMPLE QUESTIONS  

    Q.1.Write timeline for RoundRobin Scheduling.


    Q.2.Explain how a semaphore that can hold an arbitary value be implemented using only binary Semaphores and ordinary machine instructions? 

    Q.3What are three ways in which a thread can enter the waiting state? 

    Q.4What are the management functions of an operating system? 
    Q.5.Explain the concept of recovery from deadlock.

    Q.6What are the necessary conditions for a deadlock?

    Q.7.What are the functions of a distributed operating system?


    Paper-2


    1.Producer consumer problem can be solved using-
        a)semaphores          b)event counters
        c)monitors                d)all of the above
        

    2.Dijkstra's banking algorithm solves the problem of-
        a)deadlock avoidance        b)deadlock recovery
        c)mutual exclusion             d)context switching

    3.At a particular time the value of a counting semaphore is 10.It will become 7 after-
       a)3 V operations            b)3 P operations
       c)5 V operations 
         and 2P operations       d)13 P operations and 10V operations.

    4.A system has 3 processes sharing 4 resources.If each process needs a maximum of 2 units then deadlock-
    a)can never occur           b)may occur
    c)has to occur                 d)none of the above. 


    visitors count

    Blog Ads