Pages

Write a program to to show the working of IF condition using global variable.

Friday, 19 April 2013



#include <stdio.h>
#include <conio.h>
int a; // it is a global variable
main ()
{
  printf("enter the value of n="); // prompt
  scanf("%d",&a); //get value for integer a
  if (a==10) //if condition
printf("YOU HAVE 10 RS"); //prompt
else //if condition is wrong than it is execute
{
      printf("you have nothing"); //promt
        }
  getch();// hold screen until you enter a key.
}

 

Search Box

Most Reading

Contact Form

Name

Email *

Message *