24.12.19

Constant keyword program in c

If we want that the value of a variable is fixed & shold not be changed even accidentally, then such a variable is defined as const

#include<stdio.h>

void main()
{

const int a=512;

printf("%d",a);

}

OUTPUT:

512

No comments:

Post a Comment

JAVA program pattern 2

import java.util.Scanner; public class pattern3 { public static void main(String args[]) { int i,j; Scanner sc=new Scanner(System.in); Syste...