Monday, April 13, 2020

Special operators in C

  • Program :
#include<stdio.h>
#include<conio.h>
#include<limits.h>
void main()
{
int *a,b,c;
char d;
float e;
double f;
clrscr();
printf("\n----------------SPECIAL OPERATORS----------------");
printf("\nEnter B value:");
scanf("%d",&b);
printf("\n----------------SPECIAL OPERATOR(&)----------------");
a=&b;
printf("\nThe address of a memory location is : %d",a);
printf("\n----------------SPECIAL OPERATOR(*)----------------");
printf("\nPointer to a variable is : %d",*a);
printf("\n----------------SPECIAL OPERATOR(sizeof())----------------");
printf(" \nSize for int is : %d",sizeof(c));
printf(" \nSize for char is : %d",sizeof(d));
printf(" \nSize for float is : %d",sizeof(e));
printf("\nSize for double is : %d",sizeof(f));
getch();
}

  • Output :




No comments:

Post a Comment

Function Overloading in C++

https://monitechvenkat1620.blogspot.com Program : #include <iostream> using namespace std; int c(int x, int y) {   return...