programming9
  • Flowcharts
  • Programs
      • Back
      • C Programs
      • C++ Programs
      • Java Programs
      • Python Codes
      • HTML Codes
      • Java Script Codes
      • SQL Codes
  • Tutorials
      • Back
      • Java Tutorials
      • Competitive Programming
      • Python Tutorials
      • C Programming
  • Blog
  • Login

C Program to Implement Call By Value using Functions

Details
Written by: RajaSekhar
Category: C Programs
  • C Functions
#include <stdio.h>
swap (int, int);
main()
{
    int a, b;
    printf("\nEnter value of a & b: ");
    scanf("%d %d", &a, &b);
    printf("\nBefore Swapping:\n");
    printf("\na = %d\n\nb = %d\n", a, b);
    swap(a, b);
    printf("\nAfter Swapping:\n");
    printf("\na = %d\n\nb = %d", a, b);
    getch();
}
swap (int a, int b)
{
    int temp;
    temp = a;
    a = b;
    b = temp;
}

 OUTPUT:

Enter value of a & b: 10 20

Before Swapping:

a = 10

b = 20

After Swapping:

a = 10

b = 20

You can Find Example program for Call-By-Reference here.

Previous article: Swapping of Two Numbers Using Call By Reference in C Prev Next article: C Program to Find Length of a String Using STRLEN() Next
  • C Program to Calculate Sum of Marks to Demonstrate Structures
  • C Program for Matrix Multiplication
  • C Program to Print ASCII values of Characters
  • C Program to Convert Infix to Postfix Expression using Stack
  • C Program to Find Area of Rectangle
  • C Program to Check Given Number is PRIME or Not
  • C Program to Find Biggest of Two Numbers using Ternary
  • C Program to Implement SHELL SORT
  • Check a Character is Vowel or not Using C
  • C Program to Reverse Elements in Array
  • C Program to Find Simple Interest
  • C Program to Find Area of a Square
  • C Program to Find Sum of All Array Values
  • C Program to Implement SJF CPU Scheduling Algorithm
  • Fizz Buzz Implementation in C
  • Privacy Policy
  • Cookie Policy
© programming9.com 2026
Back to top