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 Find Sum of Individual Digits of a Positive Integer Number
  • C Program for String Concatenation without using strcat()
  • Evaluate Algebraic Expression (ax+b)/(ax-b)
  • C Program to Calculate NCR
  • C Program to Find Factorial of a Number using While Loop
  • C Program to Implement CONTINUE statement
  • C Program to Evaluate POSTFIX Expression Using Stack
  • C Program to Find Area of a Triangle
  • C Program to Find Simple Interest
  • C Program to find Reverse of a Number
  • C Program to Implement Doubly Linked List Operations
  • C Program to Print Elements of Array Using Pointers
  • C Program to Find Area and Circumference of a circle.
  • Finding GCD and LCM of Given Numbers using C
  • C Program to convert Celsius to Fahrenheit
  • Privacy Policy
  • Cookie Policy
© programming9.com 2026
Back to top