ProfessorD.org About C Programming Tutorials C ++ Tutorials Data Structure UNIX/Linux Internship/Major Minor Project

C Programming Practical Lab Assignment Exercises

List of practical programmes in C Language for M. Tech / M.C.A., / B.E./ B.Tech./ Computer Science / B.Sc. / BCA PRACTICAL PROGRAMMING & PROBLEM SOLVING THROUGH C - I / II

Write a C program to add two number using pointer.


#include "stdio.h"
int main()
{
    int first_no, second_no, *pointer_var_1, *pointer_var_2, sum;
    printf("Enter first integer value to add  :");
    scanf("%d", &first_no);
    printf("Enter second integer value to add :");
    scanf("%d", &second_no);
    pointer_var_1 = &first_no;
    pointer_var_2 = &second_no;
    sum = *pointer_var_1 + *pointer_var_2;
    printf("Sum of the numbers = %d\n", sum);
    return 0;
}        

Follow us for Video tutorials on Youtube