Sunday, April 10, 2016

C programming Language Code Examples-scanf(4)

Smiley face

Code:

Smiley face

Output:

Smiley face

note:

int a=4; - 'int' type variable 'a'. it value is '4'
but sometime we want to get value from user so
int a;
then get user input from 'scanf'

Code:

Smiley face

Output:

Smiley face

note:

if you want to print 2 variable-printf("%d%d",a,b);
if you want to scan 2 variable -scanf("%d%d",&a,&b);

Code:

Smiley face

Output:

Smiley face

note:

if you want to get different type input
first get 'charter' variable from user
otherwise there is a error

No comments:

Post a Comment

Wel Come !!! computer express