This is a C program using function with no argument no return value.

Source Code:

  1. #include<stdio.h>
  2. #include<conio.h>
  3. void add();
  4.    //main....
  5. int main()
  6. {
  7.    //calling function. 
  8.   add();
  9.   getch();
  10.   
  11. }
  12. //function prototype.
  13. void add()
  14. {
  15. int a,b,add;
  16. printf("GFive value:");
  17. scanf("%d  %d", &a,&b);
  18. add =a+b;
  19. printf("addition is =%d",add);
  20. }

Output:

      1.    Give value:5 10
             Addition is =15
      
      2.   Give value:48 98
            Addition is =146

0 comments:

Post a Comment