# Tag Archives: given

## Write a C program to determine a given matrix is a sparse matrix – IGNOU MCA Assignment 2017 – 18

MASTER OF COMPUTER APPLICATIONS Course Code: MCS-011 Course Title : Problem Solving and Programming Assignment Number : MCA(1)/011/Assign/2017-18 Maximum Marks : 100 Write a program to find the largest element in an array using Recursion – IGNOU MCA Assignment 2017 – 18 Program: #include<stdio.h> void main() { int MATRIX[10][10]; int I,J,M,N; int COUNT=0; clrscr(); printf(“ENTER… Read More »

## Write a program in ‘C’ to check whether the given year is leap or not. Also explain the logic of the program. 8m Dec2008

Write a program in ‘C’ to check whether the given year is leap or not. Also explain the logic of the program. 8m Dec2008 The leap year formula is: A leap year is divisable by 4, but not by 100 (except if divisable by 400.)   #include<stdio.h> void main(){ int year; clrscr(); printf(“Enter any year:… Read More »

## Write a macro to find out whether the given character is lower case or not 7m Dec2008

Write a macro to find out whether the given character is lower case or not 7m Dec2008 3. (a) Write a macro to find out whether the given character is lower case or not. 7 #include <stdio.h> //#define IS_UPPER_CASE(n) ((n) >= ‘A’ && (n) <= ‘Z’) #define IS_LOWER_CASE(n) ((n) >= ‘a’ && (n) <= ‘z’)… Read More »

## Write a macro to find the smallest number among 3 given numbers. 7m Jun2007

Write a macro to find the smallest number among 3 given numbers. 7m Jun2007 Code: #include<stdio.h> #define MIN(X,Y)(X<Y ? X:Y) #define SMALL(X,Y,Z)(MIN(X,Y)<Z ? MIN(X,Y):Z) void main() { int FIRST,SECOND,THIRD; clrscr(); printf(“ENTER NUMBERS TO COMPARE\n”); printf(“\nFIRST NUMBER : “); scanf(“%d”, &FIRST); printf(“\nSECOND NUMBER : “); scanf(“%d”, &SECOND); printf(“\nTHIRD NUMBER : “); scanf(“%d”, &THIRD); printf(“\nThe SMALLER NUMBER IS… 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 »

## An Assembly language program to find substring in given string – IGNOU MCA Assignment 2014-15

BACHELOR OF COMPUTER APPLICATIONS Course Code : BCSL-022 Course Title : Assembly Language Programming Lab Assignment Number : BCA(II)/BCSL022/Assign/14-15 Maximum Marks : 50 Weightage : 25%   Write and run an Assembly language program that finds the occurrence of a given substring, for example, BCS in a given string, for example, AXYBCSDEF (please note that in… Read More »

## An Assembly program to convert lower case to upper case – IGNOU MCA Assignment 2014 – 15

MASTER OF COMPUTER APPLICATIONS Course Code : MCSL-017 Course Title : C and Assembly Language Programming Assignment Number : MCA(1)/L017/Assign/2014-15 Maximum Marks : 100 Weightage : 25%   Write a program in assembly language for converting lower case to upper case in a given string of characters.   DATA SEGMENT MSG1 DB 10,13,’ENTER ANY STRING… 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 »

## Draw a flow chart and write a program in C to sort a given list of numbers. 7m Jun2007

Draw a flow chart and write a program in C to sort a given list of numbers. 7m Jun2007   Flowchart: Code: #include<stdio.h> void main() { int I,J,Temp,List[]={6,3,0,4,8,2,5,9,1,7}; clrscr(); printf(“List Before Sorting :\n”); for(J=0;J<10;J++) { printf(“%d “,List[J]); } for(I=0;I<10;I++) { for(J=0;J<=I;J++) { if(List[J]>List[I]) { Temp=List[I]; List[I]=List[J]; List[J]=Temp; } } } printf(“\nList Before Sorting :\n”); for(J=0;J<10;J++)… Read More »

## Write a program to count the number of characters and words in a given file. 10m Jun2007

Write a program to count the number of characters and words in a given file. 10m Jun2007  #include<stdio.h> #include<process.h> void main() { FILE *fp; int chr=0,wrd=1,str; clrscr(); if((fp=fopen(“test.txt”,”r”))== NULL) { printf(“File does not exist\n”); exit(0); } while(!(feof(fp))) { str=fgetc(fp); if(str==’ ‘) wrd++; chr++; } printf(“The number of characters in file :%d\n”,chr); printf(“The number of words… Read More »