Posts

Showing posts with the label Pointers

Date Time Correcter in C

Question Develop a program to enter a date and check if it correct, keeping the days of each month and the concept of Leap year in mind.

Call By reference

Image
Call by Reference A classic example of call by reference is : #include <stdio.h> void add(int *num1,int *num2) {     *num1=5;     *num2=10; } int main() {     int a,b;     printf("\n Enter two numbers : ");     scanf("%d%d",&a,&b);     add(&a,&b);     printf("\n %d %d ",a,b);     return 0; }