21
Page | 19 15 Convert (A+B)(AB’+AC)(A’C’+B’C’) to SOP form. 16 Convert (A+B)(B’+C)(A’+C) to SOP Form. 17 Prove XY+YZ+Y’Z=XY+Z algebraically. 18 Draw the Truth Table for XOR and XNOR Gate. 19 Prove that NAND and NOR Gate are universal gate. 20 Explain the Relation ship between minterms and maxterms. An Expression is given in SOP form F(x,y,z)=S(0,1,4,5) show its min terms and maxterms. 21 Represent (A’+B’+C’)(A+B’+C’) in NOR to NOR logic network. 22 Draw the simplified logic diagram using only NAND gates to implement the three input function f denoted by the expression (Not By using K Map) F= ( 0,1,2,5) 23 Express P+Q’R in canonical SOP Form and POS Form. 24 Express the Boolean Function F(x,y,z) =xy+x’z in a product of max term form. 25 Write the equivalent canonical Sum of Product expression for the following Product of Sum Expression F(X,Y,Z)= π (1,3,6,7) 26 A majority gate is a digital circuit whose output is equal to 1 if the majority of the inputs are 1. The output is 0 otherwise. By means of a truth table, find the Boolean expression implemented by 3 input majority gates. 27 An even parity gate is a digital circuit whose output is equal to 1 if the odd numbers of inputs are 1. The output is 0 otherwise. By means of a truth table (a) Find the Boolean function implemented by a 3 input odd parity gate. (b) Which single gate can be used to represent this circuit 3 Marks Questions Programming in C++ 1 Give output of following code fragment: int val, res, n = 1000; cin >> val; res = n + val > 1750 ? 400 : 200; cout << res; (a) if the input is 2000. (b) if the input is 1000. (c) if the input is 500. 2 What will be the output if input is: (i) a (ii) c (iii) d (iv) h (v) b char ch, out [10] = “ ”; cin >> ch; switch (ch) { case ‘a’: strcat(out, “a”); case ‘b’: strcat(out, “b”); case ‘c’: strcat(out, “c”); break; case ‘d’: strcat(out, “d”); break; default : strcat(out, “Not abcd”); Downloaded from www.studiestoday.com Downloaded from www.studiestoday.com www.studiestoday.com

22 23 24 25 26 mark questions.pdfPage| 19 15 Convert (A+B)(AB’+AC)(A’C’+B’C’) to SOP form. 16 Convert (A+B)(B’+C)(A’+C) to SOP Form. 17 Prove XY+YZ+Y’Z=XY+Z algebraically

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

P a g e | 19

15 Convert (A+B)(AB’+AC)(A’C’+B’C’) to SOP form.

16 Convert (A+B)(B’+C)(A’+C) to SOP Form.

17 Prove XY+YZ+Y’Z=XY+Z algebraically.

18 Draw the Truth Table for XOR and XNOR Gate.

19 Prove that NAND and NOR Gate are universal gate.

20 Explain the Relation ship between minterms and maxterms. An Expression is given in SOP form F(x,y,z)=S(0,1,4,5) show its min terms and maxterms.

21 Represent (A’+B’+C’)(A+B’+C’) in NOR to NOR logic network.

22 Draw the simplified logic diagram using only NAND gates to implement the three input function f denoted by the expression (Not By using K Map) F= ∑( 0,1,2,5)

23 Express P+Q’R in canonical SOP Form and POS Form.

24 Express the Boolean Function F(x,y,z) =xy+x’z in a product of max term form.

25 Write the equivalent canonical Sum of Product expression for the following Product of Sum Expression F(X,Y,Z)= π (1,3,6,7)

26 A majority gate is a digital circuit whose output is equal to 1 if the majority of the inputs are 1. The output is 0 otherwise. By means of a truth table, find the Boolean expression implemented by 3 input majority gates.

27 An even parity gate is a digital circuit whose output is equal to 1 if the odd numbers of inputs are 1. The output is 0 otherwise. By means of a truth table (a) Find the Boolean function implemented by a 3 input odd parity gate. (b) Which single gate can be used to represent this circuit

3 Marks Questions

Programming in C++

1 Give output of following code fragment: int val, res, n = 1000; cin >> val; res = n + val > 1750 ? 400 : 200; cout << res; (a) if the input is 2000. (b) if the input is 1000. (c) if the input is 500.

2 What will be the output if input is: (i) a (ii) c (iii) d (iv) h (v) b

char ch, out [10] = “ ”; cin >> ch; switch (ch) { case ‘a’: strcat(out, “a”); case ‘b’: strcat(out, “b”); case ‘c’: strcat(out, “c”); break; case ‘d’: strcat(out, “d”); break; default : strcat(out, “Not abcd”);

Downloaded from www.studiestoday.com

Downloaded from www.studiestoday.com

www.stu

dies

toda

y.co

m

P a g e | 20

} cout << out << endl;

3 Give output of following code fragment: char *msg = “a ProFile”; for (int i = 0; i < strlen (msg); i++) if (islower(msg[i])) msg[i] = toupper (msg[i]); else if (isupper(msg[i])) if( i % 2 != 0) msg[i] = tolower (msg[i-1]); else msg[i--]; cout << msg << endl;

4 Give output of following code fragment: 5char *msg = “WELCOME”; for (int i = strlen (msg) - 1; I >= 0; i--) if (islower(msg[i])) msg[i] = toupper (msg[i]); else

if (isupper(msg[i])) if( i % 2 != 0) msg[i] = tolower (msg[i-1]); else msg[i--]; cout << msg << endl;

5 Find output #include<iostream.h> struct Box { int Len, Bre, Hei; }; void Dimension(Box B) { cout << B.Len << “ X ” << B.Bre << “ X ”; cout << B.Hei << endl; } void main ( ) { Box B1 = {10, 20, 8}, B2, B3;

++B1.Hei; Dimension (B1); B3= B1; ++B3.Len; B3.Bre++; Dimension (B3); B2= B3; B2.Hei += 5; B2.Len - = 2;

Downloaded from www.studiestoday.com

Downloaded from www.studiestoday.com

www.stu

dies

toda

y.co

m

P a g e | 21

Dimension (B2); }

6 Give output int Execute( int M) { if (M % 3 = 0) return M * 3; else return M + 10; } void output( int B = 2) { for (int T = 0; T < B; T++) cout << Execute(T) << “*”; cout << endl; } void main() { output (4); output ( ); output (3); }

7 Give the output of the following program: void main()

{ int ar[] = {2, 3, 4, 5}; int *ptr = arr; int val = *ptr; cout << val << endl; val = *ptr ++; cout << val << endl; val = *ptr; cout << val << endl; val = * ++ptr; cout << val << endl; }

8 Give the output of the following program: void main() { int ar[] = {2, 3, 4, 5}; int *ptr = arr; int val = *ptr; cout << val << endl; val = *ptr ++; cout << val << endl; val = *ptr; cout << val << endl; val = * ++ptr; cout << val << endl; }

9 Give the output of the following program : #include<iostream.h> struct point {

Downloaded from www.studiestoday.com

Downloaded from www.studiestoday.com

www.stu

dies

toda

y.co

m

P a g e | 22

int x,y; }; void showpoint p) { cout<<p.x<< ‘:’<<p.y<<endl; } void main() { point u = {20,10},V,W; v=u; v.x+=20; w=v; u.y+=10; u.x+=5; w.x-=5; show(u); show(v); show(w); }

10. Write the output of the following program : #include<iostream.h> int calc(int u) { if(u%2==0) return u+10; else return u*2; } void pattern(char M, int B=2) { for(int cnt=0;cnt<b;cnt++) cout<<calc(cnt)<<m; cout<<endl; } void main() { pattern(‘*’); pattern(‘#’,4); pattern(‘@’,3); }

11 Find the output of the following program: #include<iostream.h> #include<conio.h> void ChangeContent(int Arr[], int Count) { for(int C=1 ; C<Count ; C++) { Arr[C-1]+=Arr[C] ; }

Downloaded from www.studiestoday.com

Downloaded from www.studiestoday.com

www.stu

dies

toda

y.co

m

P a g e | 23

} void main() { clrscr( ); int A[ ]={3, 4 , 5}, B[ ]={10,20,30,40}, C[ ]={900, 1200}, L ; ChangeContent(A,3); ChangeContent(B,4); ChangeContent(C,2); for(L=0 ; L<3 ; L++) { cout<<A[L]<<"#"; } cout<<endl; for(L=0 ; L<4 ; L++) { cout<<B[L]<<"#" ; } cout<<endl; for(L=0 ; L<2 ; L++) { cout<<C[L]<<"#" ; } getch(); }

12 Find the output of the following program: #include<iostream.h> #include<conio.h> struct Game { char Magic[20]; int Score; }; void main() { clrscr(); Game M={"Tiger", 500} ; char *Choice ; Choice = M.Magic; Choice[4]='P' ; Choice[2]='L' ; M.Score+=50; cout<<M.Magic<<M.Score<<endl; Game N= M; N.Score-=120 ; cout<<N.Magic<<N.Score<<endl; getch(); }

13 Write the output of the following program: #include<iostream.h>

Downloaded from www.studiestoday.com

Downloaded from www.studiestoday.com

www.stu

dies

toda

y.co

m

P a g e | 24

#include<string.h> #include<ctype.h> void convert (char str[], int len) { for (int count =0; count <len; count++) { if ( isupper(str[count])) str[count]=tolower(str[count]); else if ( islower(str[count])) str[count]=toupper(str[count]); else if ( isdigit(str[count])) str[count]=str[count]+2; else str[count]= ‘#’; } } void main() { char text[]= “AISSCE 2008@”; int size =strlen(text); convert (text,size); cout<<text<<endl; for (int c =0, r=size-1; c<=size/2;c++, r--) { char temp= text[c]; text [c]= text[r]; text[r]= temp; } cout<< text << endl; }

14 Give the output of the following program. #include < iostream.h > #include <conio.h > int a = 10; int main( ) { void demo ( int &, int , int *); clrscr( ); int a = 20; demo ( ::a,a,&b); cout << ::a << “\t” << a << “\t” << b; } void demo ( int &x, int y , int *z ) { a += x; y *= a; *z = a+y; cout << x << “\t” << y << “\t” << *z << endl;

}

15 Write the output of the follwoing program segment

Downloaded from www.studiestoday.com

Downloaded from www.studiestoday.com

www.stu

dies

toda

y.co

m

P a g e | 25

char *NAME="ComPUteR"; for(int x=0;x<strlen(NAME);x++) if(islower(NAME[x])) NAME[x]=toupper(NAME[x]); else if(isupper(NAME[x])) if(x%2==0) NAME[x]=tolower(NAME[x])); else NAME[X]=NAME[x-1];

puts(NAME);

16 What will be the output of the following program #include<iostream.h> #include<ctype.h> #include<conio.h> #include<string.h> void changestring(char text[], int &counter) { char *ptr = text; int length=strlen(text); for(;counter<length-2;counter+=2,ptr++) { *(ptr+counter) = toupper(*(ptr+counter)); } } void main() { clrscr(); int position = 0; char message[]= “Mouse Fun”; changestring(Message,position); cout<<message<< “@” <<position; }

17 What will be the output of the following program: #include<iostream.h> #include<ctype.h> #include<conio.h> #include<string.h> void changestring(char text[], int &counter) { char *ptr = text; int length=strlen(text); for( ;counter<length-2; counter+=2,ptr++) { *(ptr+counter) = toupper(*(ptr+counter)); } } void main()

Downloaded from www.studiestoday.com

Downloaded from www.studiestoday.com

www.stu

dies

toda

y.co

m

P a g e | 26

{ clrscr(); int position = 0; char message[]= “Pointer Fun”; changestring(Message, position); cout<<message<< “@” <<position; }

18. Find the output of the following program # include<iostream.h> #include<string.h> class state { char * state_name; int size; public; state( ); { size=0; state_name=new char[size+1]; } state(char *s) { size = strlen(s) ; state_name = new char[size+1];} strcpy(state_name, s); } void display() {cout<<state name<<endl; } void Replace (state &a, state &b) { size = a.size + b.size; delete state_name; state_name = new char[size+1] ; strcpy(state_name, a.state_name); strcat(state_name, b.state_name); } }; void main( ) { char *temp = “Delhi”; state state1(temp), state2(”Mumbai”), state3(”Nagpur”), S1, S2; S1.Replace(state1, state2); S2.Replace(S1, state3); S1.display( ); S2.display( ); }

19 Rewrite the following program after removing the syntactical error(s), if any. Underline each correction. #include <iostream.h> void main( ) { struct movie { char movie_name [20]; char movie type; int ticket cost = 100; }MOVIE; gets(movie_name); gets(movie_type); }

Downloaded from www.studiestoday.com

Downloaded from www.studiestoday.com

www.stu

dies

toda

y.co

m

P a g e | 27

20 Find the output of the following program: #include<iostream.h> #include<string.h> class student { char *name; int I ; public: student( ) {I =0; name=new char [ I +1]; } student (char *s) { I =strlen(s); name=new char[I+1]; strcpy (name,s); } void display( ) {cout<<name<<endl;} void manipulate(student & a, student & b) { I = a.I + b.I; delete name; name=new char[I+1]; strcpy(name, a.name); strcat(name, b.name); } }; void main( ) { char * temp = “Jack”; student name1 (temp), name2(” Jill”), name3(”John”),S1,S2; S1 .manipulate (name1, name2); S2.manipulate (S1, name3); S1.display ( ); S2.display ( ); }

21 Find the output of the following program: #include<iostream.h> #include<string.h> class country { char *country name; int length; public:. country ( ) {length =0; country_name=new char [length+1];} country (char *s) { length = strlen(s); country_name=new char [length +1]; strcpy (country_name, s); } void display ( ) { cout<< country_name <<endl;} void Replace (country & a, country & b) { length a.length + b.length; delete country_name; country_name=new char [length + 1]; strcpy (country_ name, a.country_name); strcat (country_name, b.country name); }

Downloaded from www.studiestoday.com

Downloaded from www.studiestoday.com

www.stu

dies

toda

y.co

m

P a g e | 28

}; void main ( ) { char * temp = “India”; country country1 (temp), country2 (“Nepal”), country3 (“China”), S1,S2; S1.Replace (country1, country2); S2.Replace (S1,country3); S1.display( ); S2.display ( ); }

22 Find the output of the following program: #include < iostream.h> void main( ) { int *PointerArray [10]; int marks [ = {75, 68, 90, 34, 0, 10, 90, 65}; for (int I = 0; marks [ I]!=0; I++) { PointerArray [I]=&marks[I]; * (PointerArray [I] ) += 5; } int index = 0; while(index < I ) { int p=*(PointerArray[index] ); if(p >=60) cout <<p<< ‘, ’; index ++; } }

23 class book { int book_no; char book_name[20]; float price; public: void enter_book_Details( ) { cin>> book_no>> price; gets(book_name); } void show_book_Details( ); }; Assuming a binary file “BOOK.DAT” contains objects belonging to class book, write a user defined function to add more records to the end of it.

24 Assuming a binary file “BOOK.DAT” contains objects belonging to class book, write a user defined function to add more records to the beginning of it.

25 Assuming a binary file “BOOK.DAT” contains ten objects belonging to class book, write a user defined function to add a record as fifth record to this file. After the execution of your code, the file “BOOK.DAT” should contain eleven records

26 A librarian maintains the record of books in a file named as “STOCK_BOOK.DAT”. Write a function in C++ to delete a record for book_no 10.

27 Observe the program segment carefully and answer the question that follows:

Downloaded from www.studiestoday.com

Downloaded from www.studiestoday.com

www.stu

dies

toda

y.co

m

P a g e | 29

class student { int student_no; char student_name[20]; int mark; public: void enterDetails( ) { cin>> student_no >> mark ; gets(student_name); }

void showDetail( ); int get_mark( ){ return mark;} }; Assuming a binary file “RESULT.DAT” contains records belonging to student class, write a user defined function to separate the records having mark (i) Greater than 79 into “EXCELLENT.DAT” file (ii) Greater than 59 but less than 80 into “AVERAGE.DAT” file. (iii) Remaining records should be in “RESULT.DAT” file.

28 Given the binary file TELEPHONE.DAT , containing the records of the following class Directory: class Directory { char name[20]; char address[30]; char areaCode[5]; char phone_no[15]; public: void register( ); void show( ); int checkCode( char AC[] ) { return strcmp(areaCode, AC); } }; Write a function COPYABC( ) in C++ , that would copy only those records having areaCode as “123” from TELEPHONE.DAT to TELEBACK.DAT.

29 Write a function in C++ to add a new record into a binary file “customer.dat” , if the file contains the objects of the following class: class customer { int cust_no; char name[20]; public: void getData( ) {

Downloaded from www.studiestoday.com

Downloaded from www.studiestoday.com

www.stu

dies

toda

y.co

m

P a g e | 30

cin>> cust_no; cin.getline(name, 20 ); } void showData( ); // Function to display customer details };

30 Given the binary file ITEM.DAT, containing the records of the following structure: struct item { int item_no; char item_name[20]; int stock; }; Implement the function AddStock( item x, int n), which updates a record by adding n to the

existing stock for the item x in the file.

31 Write definition for a function SUMSEQUENCE() in C++ with two arguments/parameters – double x and int n. The function should return a value of type double and it should perform sum of the following series :

1-x/1! + x2/3! - x3/5! + x4/7! - x5/9 + …………………. Up to n terms. (Note : The symbol ! represents Factorial of a number i.e. 5! = 5*4*3*2*1)

32 Write a C++ function SUMFUN() having parameters X (of type double) and n (of type integer) with a result type as double to find the sum of the series given below : X + X2/3! + X3/5! + ………….+ Xn/(2N-1)!

33 An array of a structure Student, S is required to be arranged in descending order of marks. Write a C++ function to arrange the same with the help of bubble sort. The array and its size is required to be passed as parameters to the function. Definition of structure student is as follows struct Student { int rollno; char name[20]; float marks; };

34 An array E containing elements of structure Employee is required to be arranged in descending order of salary. Write a C++ function to arrange the same with the help of Selection sort. The array and its size is required to be passed as parameters to the functions. Definitions of the structure is as follows struct Employee { int empno; char Ename[20]; float salary; };

35 Give the output of the following program :

Downloaded from www.studiestoday.com

Downloaded from www.studiestoday.com

www.stu

dies

toda

y.co

m

P a g e | 31

#include<iostream.h> #include<conio.h> #include<string.h> #include<ctype.h> void main( ) { int b; char bboy[10]; clrscr( ); bboy[0]=’d’,bboy[1]=’e’,bboy[2]=’f’,bboy[3]=’g’; len(bboy); getch( ); return 0; } void len(char boy[10]) { int l,v=0; l=strlen(boy); for (int i=0;i<=l;i++) { if ((boy[i]==’a’)||(boy[i]==’e’)||(boy[i]==’i’)||(boy[i]==’o’ || (boy[i]==’u’)) v=v+1; } cout<<l<<v; return;

}

36. Give the output of the following program : #include<iostream.h> #include<conio.h> main( ) { int number[10],a,b,c,d; clrscr( ); for(int i=0;i<10;i++) { number[i]=i+i; } clrscr( ); for(int j=0;j<9;j++)

Downloaded from www.studiestoday.com

Downloaded from www.studiestoday.com

www.stu

dies

toda

y.co

m

P a g e | 32

{ for(int k=j+1;k<10;k++) { if (number[j]>number[k]) { a=number[j]; number[j]=number[k]; number[k]=a; } } } cout<<endl; for(i=0;i<10;i++) cout<<number[i]<<“\t”;i++; getch( ); return 0; }

37 Give the output of the following program : #include<iostream.h> #include<conio.h> main( ) { int a=0; clrscr( ); char *name; name= “Internet Browsing”; for(a=0;a<=8;a++) cout<<name[a+1]; cout<<endl; cout<<name[a]; cout<<endl<<(int)name[a]-1; getch( ); return 0; }

38 Give the output of the following program : #include<iostream.h> #include<conio.h> main( )

Downloaded from www.studiestoday.com

Downloaded from www.studiestoday.com

www.stu

dies

toda

y.co

m

P a g e | 33

{ void arm(int); clrscr( ); int num; num=191; arm(num); getch( ); return 0; } void arm(int n) { int number, sum=0,dg,dgg,digit; number=n; while(n>0) { dg=n/10; dgg=dg*10; digit=n-dgg; cout<<digit+digit<<endl; sum=sum+digit*digit*digit; n=n/10; } cout<<digit<<endl<<sum; }

39 Give the output of the following program : #include<iostream.h> #include<conio.h> #include<string.h> main( ) { clrscr( ); char *name; int l; name= “SHANA”; l=strlen(name); cout<<l<<endl<<(int) name[l-2]; cout<<endl; cout<<name[l-3]; getch( );

Downloaded from www.studiestoday.com

Downloaded from www.studiestoday.com

www.stu

dies

toda

y.co

m

P a g e | 34

return 0; }

40 Give the output of the following program : #include<iostream.h> #include<conio.h> #include<stdio.h> #include<string.h> main( ) { clrscr( ); char *name; int len=0; name= “[email protected]”; len = strlen(name); len = len-1; cout<<endl; for(int i=len;i>=0;i=i-2) { cout<<name[i];} cout<<endl; cout<<i; cout<<endl; cout<<name[i+4]; cout<<endl; getch( ); return 0; }

41 Assuming the class Employee given below and a binary file EMPLOYEE.DAT contains objects of this class, write functions in C++ to perform the followings: (i) Write an object at the end of the binary file. (ii) Update the salary of all the employees whose salary is 10000 with a new salary

20000. class Employee{ int emp_no; char name[20]; float salary; public: void getData( ) { cin>> emp_no>>salary;

Downloaded from www.studiestoday.com

Downloaded from www.studiestoday.com

www.stu

dies

toda

y.co

m

P a g e | 35

gets(name); } void setSalary(float f ) { salary = f; } float get_salary( ) { return salary; } };

42 What is the output of the following program( Assume all necessary header files are included) :

void main( ) { char *name= “IntraNet”; for ( int i = 0; i < strlen( name) ; i++) { if ( islower( name[i]) ) name[i] =toupper(name[i]) ; else name[i] = name[i - 1] ; }

} 43 What is the output of the following program( Assume all necessary header files are

included) : void main( ) { char * name= “teAmIndia”; for ( int i = 0; name[i] ! = ‘\0’ ; i + 2) { if ( islower( name[i]) ) name[i] = toupper(name[i]) ; else name[i] = tolower(name[i]); }

} 44 What is the output of the following program( Assume all necessary header files are

included) : void main( ) {

Downloaded from www.studiestoday.com

Downloaded from www.studiestoday.com

www.stu

dies

toda

y.co

m

P a g e | 36

char * name= “ThE bESt mAN wINs”; for ( int i = 0; name[i] ! = ‘\0’ ; i + 1) { if ( islower( name[i]) ) name[i] = toupper(name[i]) ; else if( isupper(name[i]) ) if ( i % 2 = = 0) name[i] -- ; else name[i] = tolower(name[i - 1] }

} 45 What is the output of the following program( Assume all necessary header files are

included) : void main( ) { char * str = “TEACHER”; for ( int i = strlen(str) – 1 ; i >= 0 ; i --) { for ( int x = 0 ; x <= i ; x ++) cout<<s[x] ; cout<<”\n”; }

} 46 What is the output of the following program( Assume all necessary header files are

included) : void main( ) { int * p[10]; int score[] = {80, 30, 74, 50, 34, 67,0, 98}; for ( int i = 0 ; score[i] != 0 ; i ++) { p[i] = & score[i]; *(p[i]) += 10; } int count = 0; while( count < i) { int q = *(p[count]); count++ ; if(q > 50) cout<<q<< “,” ; }

}

Downloaded from www.studiestoday.com

Downloaded from www.studiestoday.com

www.stu

dies

toda

y.co

m

P a g e | 37

47 What will be the output of the following program :

# include<iostream.h> #include<ctype.h> #include<conio.h> #include<string.h> void NewText(char str[ ], int & pos) { char * p = str; int length = strlen(p); for( ; pos < length - 2; pos += 2 , p++) { *(p + pos) = toupper(*(p+pos)); } cout<<str; } void main( ) { clrscr( ); NewText(“Good Morning”, 0) ; }

48 What is the output of the following program( Assume all necessary header files are included) :

# include <iostream.h> # include<ctype.h> #include<string.h> #include<conio.h> class country{ char * c_name; int length; public: country( ) { length = 0; c_name = new char[length+1]; } country(char * s) { length = strlen(s); c_name = new char[length+1]; strcpy(c_name, s); }

Downloaded from www.studiestoday.com

Downloaded from www.studiestoday.com

www.stu

dies

toda

y.co

m

P a g e | 38

void display() { cout<<c_name<<endl; } void replace(country &a, country &b) { length= a.length+b.length; c_name = new char[length+1]; strcpy(c_name, a.c_name); strcpy(c_name, b.c_name); } }; void main( ) { char *temp="India"; clrscr( ); country c1=temp, c2("Nepal"),c3; c3.replace(c1,c2); c3.display( ); getch( ); }

53 Find the output of the following program # include<iostream.h> void main ( ) { char *name; node *next; } node n[ ]={ {“Anamika”, n+1}, {“Shruthi”,n+2}, {“Swathi”,n} }; node * m[3]; for(int i=0;i<3;i++) m[i]=n[i].next; cout.write(m[0]->name,7); cout.put(‘\n’); cout.write((*m)->name,7); cout.put(‘\n’);

49. Write a function in C++ to count the number of vowels present in a text file STORY.TXT”.

Downloaded from www.studiestoday.com

Downloaded from www.studiestoday.com

www.stu

dies

toda

y.co

m

P a g e | 39

BOOLEAN ALGEBRA 1 Solve the following F(a,b,c,d)=∑(0,1,3,4,5,7,8,9,11,12,13,15). Obtain the simplified form using

K-Map.

2 Minimize F (a, b, c, d ) = � �1, 2, 3, , 11, 12, 14, 15) using K-map.

3 Given the logic function F = xyz + yz’w + x’yz. Minimize it using K- Map.

4 Obtain a simplified form for the following Boolean Expression using K Map and after simplifying draw its circuit diagram. F=m0+m1+m2+m4+m5+m7+m8+m9+m10+m11

5 Obtain a simplified form for the following Boolean expression using K-Map and draw its circuit diagram. F=M0.M1.M3.M5.M8.M10.M13

6 Obtain the simplified form of a Boolean Expression using Karnaugh Map F(w,x,y,z)=S(0,1,2,3,4,8,9,10,11)

7 Reduce the following Boolean Expression with the help of Karnnaugh Map F(U,V,W,Z)=S(0,1,2,3,12,13,14,15)

8 Use K Map to simplify the Boolean function F(a,b,c,d)= ∑(1,3,4,5,6,7,9,11,12,13,14,15)

9 A combinational circuit has 4 inputs and one output. Output is 1 when • all the inputs are equal to 1 • none of the inputs are equal to 1 • an odd number of inputs are equal to 1

(a) Obtain the truth table (b) Find the simplified output function in SOP Form (c) Find the simplified output function in POS Form (d) Draw the logic diagram

10 There are 4 parallel railway tracks at a place. It is desired to design a logic circuit, which can give a signal when three or more trains pass together at any given time i) Draw the truth table for the above problem ii) Simplify the expression using K – Map iii) Draw the circuit diagram

11 Output of 4 input (x,y,z,w) Boolean function F is 1 when i) At least two variable have the truth value 1 ii) At least three variable have the truth value 1 iii) Only when the three variable have the truth value 1 Draw the truth table. Solve it by using K map in Product of Sum terms

12 Minimize the Boolean Expression using XYZ+XYZ’+XY’Z’ +X’Y’Z’+ X’YZ using Karnaugh Map

13 Simplify for the function F=π(0,3,7,8,9,12,13)

14 Draw the truth table for a full adder and then simplify the Sum and Carry by using K-map. After that draw its circuit diagram.

15 Give the logic function F=AB+A’B’+A’B. Assuming the complements are available. Simplify the function using De Morgan’s Theorem. Synthesize F by using NOR gates only.

Downloaded from www.studiestoday.com

Downloaded from www.studiestoday.com

www.stu

dies

toda

y.co

m