Declaring, reading and printing of different data types

Declaration Reading scanf()Printing output printf()
char c;scanf("%c",&c);printf("%c",c);
unsigned char uc; scanf("%c",&uc);printf("%c",uc);
int i;scanf("%d",&i);printf("%d",i);
unsigned int i;scanf("%u",&i);printf("%u",i);
short int i;scanf("%d",&i);printf("%d",i);
unsigned short int i;scanf("%d",&i);printf("%d",i);
long int i;scanf("%ld",&i);printf("%ld",i);
unsigned long int i;scanf("%lu",&i);printf("%lu",i);
float x;scanf("%f",&x);printf("%f",x);
double y;scanf("%lf",&y);printf("%lf",y);
long double z;scanf("%Lf",&z);printf("%Lf",z);


* indicates required
Subscribe to plus2net

    Post your comments , suggestion , error , requirements etc here

    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2022 All rights reserved worldwide Privacy Policy Disclaimer