Thursday, 28 December 2017

Learn C language Part 21 Introduction to Function, Difference b/w void ...







#include <stdio.h>

#include <conio.h>



int sum(int a,int b);



main()

{



int z,y,x;



printf("Enter the number: ");

scanf("%d",&x);

printf("Enter the 2nd number: ");

scanf("%d",&y);



z=sum(x,y);





printf("%d",z);





}

//main method end..............



int sum(int a,int b)

{

return a+b;

}

----------------------------------------------------------------------------------------------------------------

#include <stdio.h>
#include <conio.h>

void sum(int a,int b);

main()
{

int y,x;

printf("Enter the number: ");
scanf("%d",&x);
printf("Enter the 2nd number: ");
scanf("%d",&y);

sum(x,y);


//printf("%d",z);


}
//main method end..............

void sum(int a,int b)
{
printf("%d",a+b);
}


No comments:

Post a Comment

Pass Dynamically Added Html Table Records List To Controller In Asp.net MVC

Controller Code: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using ...