#include <stdio.h>
int main(void) {
float a = 3.14;
printf("%f",a%3);
return 0;
}
Wednesday, 28 February 2018
C interview question 8
Tuesday, 27 February 2018
C interview question 7
#include <stdio.h> int main(void)
{
char c='D';
printf ("%c",c+1);
return 0;
}
E
Reason:
Char c will store the ASCII value of D
When you print C+1 the next char to D that is E is being printed in the output.
Monday, 26 February 2018
C interview question 6
void main()
{
int i=1;
i=!i>2;
printf ("i=%d",i);
}
Ans: 0
Reason:
!1 will be 0 [Because of precedence of operator, ! Operator has more precedence than the > operator]
0 is compared with 2
Condition greater than fails
So the value of i will be 0
Sunday, 25 February 2018
C interview question 5
Saturday, 24 February 2018
Friday, 23 February 2018
C interview question 4
#include <stdio.h>
void main()
{
int a;
a=9;
a=printf("Dcoder")+printf("Blog");
printf("%d",a);
}
Reason:
The return type of printf() is integer and which is being added and assigned to "a" then the value of a is displayed along with the previous outputs printf().
Thursday, 22 February 2018
C interview question 3.
What will the output of the given code ?
void main()
{
int a=3;
a=printf ("Dcoder\n");
printf ("%d",a);
}
Output:
Dcoder
7
Reason:
Return type of printf() function is integer .
It prints Dcoder then return value of printf() is assigned to a , then prints the value of a i.e.7
printf () considers "\n" also so the value is 7.
Wednesday, 21 February 2018
C Interview question.
What is the output ?
void main()
{
Int a=3,b=5;
printf("%d",++(a*b+1));
}
---------------------------------------------------------------------------
Output:
compile time error
Lvalue required.
Reason:
For the increment operator the operands should be always a variable,
Operands cannot be constant or expression.
C interview question 8
What will be the output of the given code? #include <stdio.h> int main(void) { float a = 3.14; printf("%f",a%3); ...
-
Why C is platform dependent programming language ? All programming languages are platform independent, but the executable file which is ...
-
What does static variable means? Static variable is a variable which retain its value between the function calls. They are initialized onl...
-
Function prototype Function defining return_type function_name(parameter_type parameters) { predefined logic return_value } Function ...



