GIVE ME THE EXPLANATIONOF FOLLOWING QUESTIONS
void main()
{
int i=1;
float f=2.25;
scanf("%d a %f",&i,&f);
printf("%d %.2f",i,f);
}
[NOTE : THE USER INPUT IS:5 5.75]
(a)1 2.25 (b)5 5.75 (c)5 2.25 (d)None of these
Ans. (c)
[Q023]. What will be the output of the following program :
void main()
{
char line[80]; // Max. length=80 Chars
scanf("%[^,]s",line);
printf("\n%s",l ine);
}
[NOTE : THE USER INPUT IS:Dear Friends, What is the output?]
(a)Compile-Time Error (b)Dear Friends (c)What is the output? (d)None of these
Ans. (b)
[Q022]. What will be the output of the following program :
void main()
{
int a=1,b=2,c=3;
scanf("%d %*d %d",&a,&b,&c) ;
printf("a=%d b=%d c=%d",a,b,c);
}
[NOTE : 3 values entered by the user are:100 200 300]
(a)1 2 3 (b)100 200 300 (c)100 200 3 (d)100 300 3
Ans. (d)
void main()
{
int i=1;
float f=2.25;
scanf("%d a %f",&i,&f);
printf("%d %.2f",i,f);
}
[NOTE : THE USER INPUT IS:5 5.75]
(a)1 2.25 (b)5 5.75 (c)5 2.25 (d)None of these
Ans. (c)
[Q023]. What will be the output of the following program :
void main()
{
char line[80]; // Max. length=80 Chars
scanf("%[^,]s",line);
printf("\n%s",l ine);
}
[NOTE : THE USER INPUT IS:Dear Friends, What is the output?]
(a)Compile-Time Error (b)Dear Friends (c)What is the output? (d)None of these
Ans. (b)
[Q022]. What will be the output of the following program :
void main()
{
int a=1,b=2,c=3;
scanf("%d %*d %d",&a,&b,&c) ;
printf("a=%d b=%d c=%d",a,b,c);
}
[NOTE : 3 values entered by the user are:100 200 300]
(a)1 2 3 (b)100 200 300 (c)100 200 3 (d)100 300 3
Ans. (d)
Comment