What will be output of the following “c” code?


Loading

Practice Variable Number of Arguments – What will be output of the following “c” code?


#include

int main()

{

float i, j;

scanf(%f %f, &i, &j);

printf(%.2f %.3f, i, j);

return 0;

}


What will be the output for the give input 12.342 and 123.4568

What is the final value of i and final value of LOOPS ?

Loading

Practice Control Instructions – What is the final value of i and final value of LOOPS ?


#include
int main()
{
int i,j,k,l,lc=0;

printf("Enter the number string:<1234 567>
");
scanf("%2d%d%1d",&i,&j,&k);
for(;k;k--,i++)
for(l=0;printf("%d %d
",i,l);)
printf("LOOPS= %d
", lc-1);
}

What is the output of the following problem ?

			  		

Loading

Practice Functions – What is the output of the following problem ?


#include
int main()
{
int j,ans;
j = 4;
ans = count(4);
printf("%d",ans);
return 0;
}
int count(int i)
{
if ( i < 0)
return(i);
else
return( count(i-2) + count(i-1));
}

What will be the output of the following program on GCC compiler?

Loading

Practice Functions –

What will be the output of the following program on GCC compiler?

#include<stdio.h>  
#include<string.h>
int main() {
char dest[] = {97, 97, 0};
char src[] = "aaa";
int i;
if((i = memcmp(dest, src, 2))==0) {
printf("Got it");
}
else {
printf("Missed");
}
return 0;
}

What will be the output of the following program on GCC compiler?

Loading

Practice Functions –

What will be the output of the following program on GCC compiler?

#include<stdio.h>  
#include<stdlib.h>
int main() {
char *i = "55.555";
int result1 = 10;
float result2 = 11.111;
result1 = result1 + atoi(i);
result2 = result2 + atof(i);
printf("%d, %f", result1, result2);
return 0;
}