How will you write a function with no arguments and with return value ? Give an example.

Advertisement
Q. How will you write a function with no arguments and with return value ? Give an example.
Ans. #include<stdio.h>
 
void area();  // Prototype Declaration
void main()
{
area();
}
void area()
{
    float area_circle;
    float rad;
    printf("\nEnter the radius : ");
    scanf("%f",&rad);
 
    area_circle = 3.14 * rad * rad ;
 
    printf("Area of Circle = %f",area_circle);
}

Output :


Enter the radius : 3
Area of Circle = 28.260000

Note:- if Solved Assignment will not be downloaded after the payment, checkout your email address there is a email form instamojo and there will be the option of DOWNLOAD FILES please click on that your assignment will be downloaded instantly and please open file in PDF reader.


11AM TO 6PM CALL US +919811854308 Contact us:- ignouassignmentguru@gmail.com
Previous
Next Post »
Thanks for your comment