Monthly Archives: July 2014

A C program works as DISTANCE CONVERTER cms / kms / miles to metres – 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 program called “DISTANCE CONVERTER” that accepts the distance/length in centimetres / kilometres /miles and displays its equivalent in metres.   #include<stdio.h> void main() { int… 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 »

A C program to print Values in forward and reversed order – 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 algorithm, draw a corresponding flowchart and write an interactive C program to prompt the user to input 3 integer values and print these values in forward and… Read More »

Design an algorithm, draw a corresponding flow chart and write a program in C, to swap the values using pass by value and pass by reference methods. 10m Jun2007

Design an algorithm, draw a corresponding flow chart and write a program in C, to swap the values using pass by value and pass by reference methods. 10m Jun2007  FlowChart: Program to swap two values (Pass By Value):- #include <stdio.h> main ( ) { int x = 2, y = 3; clrscr(); void swap(int, int);… Read More »

Write a program to generate the pattern 10m Jun2007

Write a program to generate the pattern 10m Jun2007 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5   Code:   #include<stdio.h> void main() { char C[]=”12345″; int I,J; clrscr(); printf(“Result :\n”); for(I=0;I<5;I++) { printf(“\n”); for(J=0;J<=I;J++) { printf(“%c “,C[J]); } printf(“\n”); } getch(); } [codesyntax lang=”c”] #include<stdio.h> void main()… Read More »

Explain the concept of a function returning a pointer with an example 6m Jun2007

Explain the concept of a function returning a pointer in C with an example 6m Jun2007 Function returning a pointer in C A function can also return a pointer to the calling program, the way it returns an int, a float or any other data type. To return a pointer, a function must explicitly mention… Read More »

Write a macro to find the sum of n numbers. 7m Jun2007

Write a macro to find the sum of n numbers. 7m Jun2007 Code: #include<stdio.h> # define SUM(n) ( (n * (n+1)) / 2 ) void main() { int num; clrscr(); printf(” Enter number : “); scanf(“%d”,&num); printf(“\n Sum of n numbers : %d “,SUM(num)); getch(); } [codesyntax lang=”c”] c#include<stdio.h> # define SUM(n) ( (n *… Read More »

Write a program in C, to copy file1 to another file2 in the same directory 7m Jun2007

Write a program in C, to copy file1 to another file2 in the same directory. 7m Jun2007 Code: #include<stdio.h> void main() { int ch,size=0; FILE *fp1; FILE *fp2; clrscr(); if((fp1=fopen(“readme.txt”,”r”))==NULL) { printf(“FILE DOES NOT EXIST\n”); exit(0); } if((fp2=fopen(“duplicate.txt”,”w”))==NULL) { printf(“FILE CAN NOT BE CREATED\n”); exit(0); } while(!feof(fp1)) { ch=getc(fp1); putc(ch,fp2); size++; } fclose(fp1); fclose(fp2); printf(”… Read More »