latest Post

Scope of variables in C Program

Program :

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

int x=1; /* external variables */
static int count=0;
int main()
{
int z; /* auto variable or local scope  */
register int answer;  // register variable
++count;
printf("\nEnter the value 1:");
scanf("%d",&x);
printf("\nEnter the value 2:");
scanf("%d",&z);
answer=x+z;
printf("\n%d.Addition : %d",count,answer);
getch();

}

Output :



About Open Learning Creative

Open Learning Creative
Recommended Posts × +

0 comments:

Post a Comment

PHP Registration form using GET, POST Methods with example

Program : HTML Code <html> <head> <title>Student Info</title> </head> <body><center> ...