Monthly Archives: June 2015

Simplify Boolean function using Karnaugh map method F (A, B, C, D): Σ (0, 2, 4, 5, 6, 7, 8, 10, 13, 15) Also, draw the corresponding logic circuit diagram. 8m Jun2007

Construct the Karnaugh map for the following function, and find the function in sum of product form. Draw the resultant logic diagram. F (A, B, C, D): Σ (0, 2, 4, 5, 6, 7, 8, 10, 13, 15). 5m Dec2007  K-Map for F is: Thus, the simplified equations for F (A, B, C, D) =… Read More »

Write a program in ‘C’ language that accepts the name of a file as input and prints those lines of the file which have the word ‘this’. 10m Dec2007

Write a program in ‘C’ language that accepts the name of a file as input and prints those lines of the file which have the word ‘this’. 10m Dec2007    #include<stdio.h> void main() { FILE *fp; int cnt=0; char str[80],lines[400]; clrscr(); if ((fp=fopen(“test.txt”,”r”))== NULL) { printf(“File does not exist\n”); exit(0); } while(!(feof(fp))) { fgets(str,80,fp); if(strcmp(“this”,str))… Read More »

A program in ‘C’ language to display the names and seat numbers of all passengers of a bus in the form of a singly linked list. Use pointers. 10m Dec2007

Write a program in ‘C’ language to display the names and seat numbers of all passengers of a bus in the form of a singly linked list. Use pointers. 10m Dec2007   #include<stdio.h> struct node { int seat; char name[20]; struct node *next; }; typedef struct node node; //with this Use “node” instead of “struct… Read More »

A program in ‘C’ language which accepts enrollment number as input and prints the name of student. pairs of students in the form of a matrix. 10m Dec2007

Write a program in ‘C’ language which accepts the enrollment number of a student as input and prints the name of that student. The program should initially store information about the (name, enrollment number) pairs of students in the form of a matrix. 10m Dec2007   #include<stdio.h> struct student { unsigned long int ENROL; char… Read More »

Write an algorithm and draw flowchart to find whether a given string S1 is substring of another string S2. 10m Dec2007

Write an algorithm and draw flowchart to find whether a given string S1 is substring of another string S2. 10m Dec2007   Algorithm Step 1: Input String and Substring (Note: Substring should be smaller than String) Step 2: Find Length of String (Len1) and Find Length of Substring (Len2) Step 3: flag <- 0 Step… Read More »

List and explain the precedence of Arithmetic, Logical and Relational operators in ‘C’. 10m Dec2007

List and explain the precedence of Arithmetic, Logical and Relational operators in ‘C’. 10m Dec2007 C uses a certain hierarchy to solve such kind of mixed expressions. The hierarchy and associatively of the operators discussed so far is summarized in Table. The operators written in the same line have the same priority. The higher precedence operators are written… Read More »

Write the syntax for the declaration of a function. Also discuss the parameter passing methods with an example program. 10m Dec2007

Explanation of FUNCTION: A function is a block of code that has a name and it has a property that it is reusable i.e. it can be executed from as many different points in a C Program as required. Function groups a number of program statements into a unit and gives it a name. This… Read More »

Design an algorithm, draw a corresponding flow chart and write a ‘C’ program for Binary Search, to search a given number among the list of numbers. 10m Dec2007

Design an algorithm, draw a corresponding flow chart and write a ‘C’ program for Binary Search, to search a given number among the list of numbers. 10m Dec2007   Algorithm Step 1: Declare an array ‘k’ of size ‘n’ i.e. k(n) is an array which stores all the keys of a file containing ‘n’ records… Read More »

Give the Excitation tables and Block diagrams for the following: 10m Jun2007

Give the Excitation tables and Block diagrams for the following: 10m Jun2007 (i)                 D flip-flop (ii)               T flip-flop   D Flip-Flop: The D flip-flop shown in Figure is a modification of the clocked SR flip-flop. The D input goes directly into the S input and the complement of the D input goes to the R… Read More »

Explain the basic principle of Quine-McCluskey method of simplifying the Boolean expression with the help of an example function. 6m Jun2007

Explain the basic principle of Quine-McCluskey method of simplifying the Boolean expression with the help of an example function. 6m Jun2007 Quine McKluskey Method A tabular method was suggested to deal with the increasing number of variables known as Quine McKluskey Method. This method is suitable for programming and hence provides a tool for automating… Read More »