Contact Learn C
Copy

Program 246 : External Storage Class in C

Program 246:  External Storage Class
 
#include<stdio.h>
float pi=3.14159;
void CalcArea(float radius);
void CalcCircumference(float radius);
main()
{
 int choice;
 float radius;
 printf("Enter\n1 to Calculate Area of Circle\n2 to Calculate Circumference\n");
 scanf("%d",&choice);
 printf("Enter radius\n");
 scanf("%f",&radius);
 switch(choice)
 {
  case 1:
  {   
   CalcArea(radius);   
   break;
  }
  case 2:
  {   
   CalcCircumference(radius);   
   break;
  }
  default:
  {
   printf("Enter Valid Choice\n");
   break;
  }
 }
}

void CalcArea(float radius)
{
 float area=pi*radius*radius;
 printf("Area of Circle with %f radius is %f\n",radius,area);
}
void CalcCircumference(float radius)
{
 float circumference=2*pi*radius;
 printf("Circumference of Circle with %f radius is %f\n",radius,circumference);
}

Explanation:
Pre Explanation:- By Default a Global Variable is '0'. And its scope is through out the Program which is why we are able to use 'pi' value even it is not declared under the respective functions as it is declared outside main() function.

//Coming Soon...

Output:

 External Storage Class in C

 External Storage Class using C







 

1 comment:

  1. college-party-guide One of the most important rituals for students in college is to throw the most memorable student dorm celebration.
    factorial hundred In the last few days, the “factorial of 100” is one of the top subjects and a lot of maths geeks compute it using voice assistants such as Alexa, Shiri, etc.
    factorial hundred In the last few days, the “factorial of 100” is one of the top subjects and a lot of maths geeks compute it using voice assistants such as Alexa, Shiri, etc.
    gigolo The term”gigolo” usually refers to the person who lives an arranged lifestyle that includes many of these relationships in a series, rather than having any other support system.
    y2mate.com y2mate.com is a well-known password management system. It lets you download all your favourite videos and audios.
    IGTools.net The term”gigolo” usually refers to the person who lives an arranged lifestyle that includes many of these relationships in a series, rather than having any other support system.
    sniffies Sniffies isn’t bookmarked on my phone, however I’ve been logged in enough that the web target will auto-complete on my personal browser.

    ReplyDelete

Donate

Download App and Learn when ever you want

Get it on PlayStore
Get it on Amazon App Store
Get it on Aptoide