8. WAP to use all format specifier for data
void
main()
{
signed short int ssi;
printf("Enter value for signed
short int :");
scanf("%hd",&ssi);
printf("Entered value for signed
short int is : %hd\n",ssi);
unsigned short int ussi;
printf("Enter value for unsigned
signed short int :");
scanf("%hu",&ussi);
printf("Entered value for unsigned
signed short int is : %hu\n",ussi);
signed int si;
printf("Enter value for signed int
:");
scanf("%d",&si);
printf("Entered value for signed
int is : %d\n",si);
unsigned int ui;
printf("Enter value for unsigned
int :");
scanf("%u",&ui);
printf("Entered value for unsigned
int is : %u\n",ui);
signed long int sli;
printf("Enter value for signed
long int :");
scanf("%ld",&sli);
printf("Entered value for signed
long int is : %ld\n",sli);
unsigned long int uli;
printf("Enter value for unsigned
long int :");
scanf("%lu",&uli);
printf("Entered value for unsigned
long int is : %lu\n",uli);
signed long long int slli;
printf("Enter value for signed
long long int :");
scanf("%lld",&slli);
printf("Entered value for signed
short int is : %lld\n",slli);
unsigned long long int ulli;
printf("Enter value for unsigned
long long int :");
scanf("%llu",&ulli);
printf("Entered value for unsigned
long long int is : %llu\n",ulli);
}
Comments
Post a Comment