Sunday, August 10, 2014

Simple C Program Using Function

#include<stdio.h>
add()
{
    int x=10,y=12,res;
    printf("enter the value of x\n");
    scanf("%d",&x);
    printf("enter the value of y\n");
    scanf("%d",&y);
    res=x+y;
    printf("the result is: %d",res);
}
main()
{
    add();
    fflush(stdin);
    getchar();
}

No comments: