Chapter:

C-Programs-on-integers

C Program to Read Two Integers M and N & Swap ir Values:

This is a C program to read two integers & swap their values.

Problem Description

This program reads two integers & swaps their values.

Problem Solution

  •  Take two integers as input.

  • Use a function for swapping process.

  • Exchange the values using another variable.

  • Print the output and exit.

Program/Source Code

/*

 * C program to read two integers M and N and to swap their values.

 * Use a user-defined function for swapping. Output the values of M

 * and N before and after swapping.

 */

#include <stdio.h>

void swap(float *ptr1, float  *ptr2);

 

....

Show More

All Chapters

View all Chapter and number of question available From each chapter from C-programming-