Tag Archives: C

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 »

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 »

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 »

A C program to prompt user with option on menu at Post Office – IGNOU MCA Assignment 2014 – 15

BACHELOR OF COMPUTER APPLICATIONS Course Code : BCSL-021 Course Title : C Language Programming Assignment Number : BCA(II)/L-021/Assign/14-15 Maximum Marks : 50 Weightage : 25%   Write an interactive C program which prompts the user with the following options on the opening menu at any Post Office: 1) Information about the Post Office 2) Details… Read More »

A C program to display a table that represents a Pascal triangle of any size – IGNOU MCA Assignment 2014 – 15

MASTER OF COMPUTER APPLICATIONS Course Code : MCS-011 Course Title : Problem Solving and Programming Assignment Number : MCA(1)/011/Assign/2014-15 Maximum Marks : 100 Weightage : 25%   Write an interactive C program to display a table that represents a Pascal triangle of any size. Hint: In Pascal triangle, the first and the second rows are… Read More »

A C program to swap the values of two variables, using pointers – IGNOU MCA Assignment 2014 – 15

 MASTER OF COMPUTER APPLICATIONS Course Code : MCS-011 Course Title : Problem Solving and Programming Assignment Number : MCA(1)/011/Assign/2014-15 Maximum Marks : 100 Weightage : 25%   Write an interactive C program to swap the values of two given variables, using pointers.   # include <stdio.h> void main() { int M,N; void swapRef ( int… Read More »

A C program to calculate total & average of score of student selected and display it – IGNOU MCA Assignment 2014 – 15

MASTER OF COMPUTER APPLICATIONS Course Code : MCS-011 Course Title : Problem Solving and Programming Assignment Number : MCA(1)/011/Assign/2014-15 Maximum Marks : 100 Weightage : 25%   Write an interactive C program to calculate the total and average of scores of a selected student. The program should prompt the student to input the stu_id. This… Read More »

A C program to add two fractions & print resultant fraction – IGNOU MCA Assignment 2014 – 15

MASTER OF COMPUTER APPLICATIONS Course Code : MCS-011 Course Title : Problem Solving and Programming Assignment Number : MCA(1)/011/Assign/2014-15 Maximum Marks : 100 Weightage : 25%   Write a C program to add two fractions and display the resultant fraction. The program should prompt the user to input Fraction-One and Fraction-Two. The numerator and denominator of each fraction‟s are… Read More »