Tag Archives: swap

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 »

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 the functions to perform the following : 10m Dec2005

Write the functions to perform the following : 10m Dec2005   (i) To find mn where m, n > 0 #include<stdio.h> void main() {  long int power(int,int);  int M,N;  long int RES;  printf(“ENTER M : “);  scanf(“%d”,&M);  printf(“ENTER N : “);  scanf(“%d”,&N);  RES=power(M,N);  printf(“\nRESULT IS %ld “,RES);  getch(); } long int power(int M,int N) {  long… Read More »