Login to ask a question from C Programs on integers

C Program to Read Two Integers M and N & Swap their 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

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

 

void main()

{

    float m, n; Show More

Previous Question Next Question
🔗

Similar Questions

From C Programs on integers · C programming

View All
WhatsApp