Tag Archives: 10m

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 »

Design and draw a master-slave flip flop using JK flipflops. What are the advantages it offers over other flip flops? 10m Jun2007

Design and draw a master-slave flip flop using JK flipflops. What are the advantages it offers over other flip flops? 10m Jun2007 Master Slave Flip Flop Master-slave flip flop consists of two flip-flops. One is the master flip-flop & other is called the slave flip-flop. The figure shows implementation of master-slave flipflop using J-K flip-flop.… Read More »

Explain any five DOS function calls supported by INT 21H in the 8086 assembly language with an example of each call. 10m jun2006

(d) Explain, with an example of each call, any five DOS function calls supported by INT 21H in the 8086 assembly language.             10   DOS Function Calls (Using INT 21H) INT 21H supports about 100 different functions. A function is identified by putting the function number in the AH register. For example, if we… Read More »