Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

Choose the correct option of C Language

Answer» CHOOSE the correct option of C Language
Below are the different QUESTIONS of C language and choose the correct answers
(1)Find output of below code
#include
int main()
{
static int a=5;
if(--a)
{
main();
PRINTF("%d ",a);
}
return 0;
}
Choose the correct options from below list
(i)1 2 3 4
(ii)4 3 2 1
(iii)0 0 0 0
(iv)Compiler Error


(2)Find output of below code
#include
int main()
{
static int i=5;
if (--i)
{
printf("%d ",i);
main();
}
}
Choose the correct options from below list
(i)1 2 3 4
(ii)4 3 2 1
(iii)0 0 0 0
(iv)Compiler Error


(3)Find output of below code
#include
int main()
{
int x = 5;
int * const ptr = &x;
++(*ptr);
printf("%d", x);
return 0;
}
Choose the correct options from below list
(i)Compiler Error
(ii)Runtime Error
(iii)6
(iv)5


(4)Find output of below code
#include
int main()
{
int x = 5;
int const * ptr = &x;
++(*ptr);
printf("%d", x);
return 0;
}
Choose the correct options from below list
(i)Compiler Error
(ii)Runtime Error
(iii)6
(iv)5


(5)Find output of below code
#include
int main()
{
typedef static int *i;
int j;
i a = &j;
printf("%d", *a);
return 0;
}
Choose the correct options from below list
(i)0
(ii)Runtime Error
(iii)Garbage Value
(iv)Compiler Error

Answer:-
(1)(iii)0 0 0 0
(2)(ii)4 3 2 1
(3)(iii)6
(4)(i)Compiler Error Reason:-++(*ptr) is INCORRECT
(5)(iv)Compiler Error Reason:- typedef static int *i;
2.

How to open file in c program with syntax and file pointer?

Answer»

How to open file in c PROGRAM with SYNTAX and file pointer?
Below is the CODE to open file in c by using file pointer. Here we have use while LOOP till the EOF to read every thing charcter by character.


Download Code

File Reading

3.

Code to print Even number in c Language

Answer» CODE to PRINT EVEN number in c Language
Below is the code in c langauge to print even number between 2 to 100. To download code click below


Download Code


Even number print
4.

Swaping of value of two variables in c through pointer?

Answer» SWAPING of value of TWO VARIABLES in c through pointer?
Below is the code to swap values between two variables in c LANGUAGE through the pointers.
Download Code


Swapping Values in C

;