SlideShare a Scribd company logo
1 of 34
Download to read offline
C Language Bit Bank
1. What will be output of the following C program?
#include<stdio.h>
int main(){
int goto=5;
printf("%d",goto);
return 0;
}
A) 5
B) 0
C) 1
D) Compilation Error
E) 4
Answer: D
Explanation: Invalid variable name. goto is keyword in C language.
Variable name cannot be a keyword of C language.
2. What will be output of the following C program?
#include<stdio.h>
int xyz=10;
int main(){
int xyz=20;
printf("%d",xyz);
return 0;
}
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
A) 10
B) 20
C) 0
D) Compilation Error
Answer: B
Explanation: Two variables can have same name in different scopes.
Local Scope is superior to Global scope.
3. What will be output of the following C program?
#include<stdio.h>
int main(){
int main = 80;
printf("%d",main);
return 0;
}
A) Compilation Error
B) 80
C) 0
D) Garbage Value
Answer: B
Explanation: Variable name can be main, which is a function and it is
not a keyword.  
4. What will be output of the following program?
#include<stdio.h>
int main(){
int a=5,b = 6;
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
swap( a, b);
printf("%d %d",a,b);
return 0;
}
void swap(int a , int b){
int temp = a;
a= b;
b = temp;
}
A) 6 5
B) 5 6
C) Garbage Value 5
D) 5 Garbage value
E) No output
Answer: B
Explanation: Scope of a, b is within the function. So, no swap happened
to variables.
If you required swapping, you have to swap their addresses.
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
5. What will be output of the following program?
#include<stdio.h>
int main(){
int i=1;
i=2+2*i++;
printf("%d",i);
return 0;
}
A) 5
B) 6
C) 8
D) 4
Answer: A
Explanation: i++ i.e. when postfix increment operator is used in any
expression, it first assigns its value in the expression then it increments
the value of variable by one. So,
i = 2 + 2 * 1
i = 4
Now i will be incremented by one so that i = 4 + 1 = 5.
6. What will be output of the following program?
#include<stdio.h>
int main(){
int i=5,j;
j=++i+++i+++i;
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
printf("%d %d",i,j);
return 0;
}
A) 5 20
B) 5 18
C) Compilation Error
D) 8 24
E) 6 24
Answer: D
Output: 8 24
Explanation:
Rule : ++ is pre increment operator. So in any arithmetic expression it
first increments the value of variable by one in whole expression, then
starts assigning the final value of variable in the expression.
Compiler will treat the expression j = ++i+++i+++i; as
i = ++i + ++i + ++i;
Initial value of i = 5 due to three pre increment operator final value of
i=8.
Now final value of i i.e. 8 will be assigned to each variable as shown in
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
7.
the follow
So, j=8+8
j=24 and
i=8
What will
#include
void main
int a=5
if(a&&b
prin
}
else{
}
}
wing figure:
8+8
l be outpu
<stdio.h>
n(){
5,b=2,c=2;
b<c++){
tf("TRUE"
printf("FA
ut when yo
");
ALSE");
ou executee the followwing C codde?
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
A) TRUE
B) FALSE
C) Compilation Error
D) Run time error
Answer: B
8. What will be output when you execute following C code?
#include<stdio.h>
void main(){
int a=5,b=10,c=1;
if(a&&b>c){
printf("SAKSHI BITBANK");
}
else{
break;
}
}
A) SAKSHI BITBANK
B) Print Nothing
C) Compilation Error
Answer: C
Explanation: Keyword break is not syntactical part of if-else statement.
So we cannot use break keyword in if-else statement. This keyword can
be used in case of loop or switch case statement.
Hence when you will compile, above code compiler will show an error
message: Misplaced break.
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
9. What will be output when you execute following C code?
#include<stdio.h>
void main(){
int a=5,b=10;
if(++a||++b)
printf("%d %d",a,b);
else
printf("HTST Quiz");
}
A) 5 10
B) 6 10
C) 6 11
D) 5 11
E) HTST Quiz
Answer: B
Explanation: Consider the following expression:
++a || ++b
In this expression || is Logical OR operator. Two important properties
of this operator are:
Property 1:
(Expression1) || (Expression2)
|| operator returns 0 if and only if both expressions return a zero
otherwise it || operator returns 1.
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
Property 2:
To optimize the execution time there is rule, Expression2 will only
evaluate if and only if Expression1 return zero.
In this program initial value of a is 5. So ++a will be 6. Since ++a is
returning a non-zero so ++b will not execute and if condition will be true
and if clause will be executed.
10. What is output of the following program?
#include<stdio.h>
void main(){
int a=5,b=10;
if(++a && ++b)
printf("%d %d",a,b);
else
printf("Sakshi");
}
A) 5 10
B) 6 10
C) 6 11
D) 5 11
E) Sakshi
Answer: C
Explanation: Consider the following expression:
++a && ++b
In this expression && is Logical AND operator. Two important
properties of this operator are:
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
Property 1:
(Expression1) && (Expression2)
&& operator returns 0 either of the expressions return a zero.
Property 2:
Here Both expressions should evaluate not like previous, based on
evaluation the result will display. So, both will evaluate.
11. What will be the output when the following C code is executed?
#include<stdio.h>
void main(){
int x=-1,y=-1;
if(++x=++y)
printf("DennisRitche");
else
printf("JamesGosling");
}
A) DennisRitche
B) JamesGosling
C) Warning: Condition is always true
D) Compilation error
Answer: D
Explanation: Consider following statement:
++x=++y
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
As we know ++ is pre increment operator in the above statement. This
operator increments the value of any integral variable by one and returns
that value. After performing pre-increments, above statement will be:
0=0
In C language, it is illegal to assign a constant value to another constant.
Left side of = operator must be a container i.e. a variable. So compiler
will show an error message: L value required.
If we want to make it true…we have to use == (Equal to operator) = is
assignment operator.
12. What will be output when you will execute following C code?
#include<stdio.h>
void main(){
if(0xA)
if(052)
if('xeb')
if('012')
printf("SAKSHI EDUCATION");
else;
else;
else;
else;
}
A)SAKSHI EDUCATION
B)Print Nothing
C)Compilation error: Misplaced else
D)Compilation error: If without any body
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
E)Compilation error: Undefined symbol
Answer: A
Explanation:
oxA: It is hexadecimal integer constant.
052: It octal integer constant.
‘xeb’: It is hexadecimal character constant.
‘012’: It is octal character constant.
As we know in C language, zero represents false and any non-zero
number represents true. All of the above constants return a non-zero
value. So all if conditions in the above program are true.
In C, it is possible to write else clause without any body.
13. What will be output when you will execute following C code?
#include<stdio.h>
void main(){
int x=1;
if(x--)
printf("X = %d"+x);
--x;
else
printf("%d",x);
}
A) 0
B) 1
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
C) Compilation Error
D) -1
Answer: C
Explanation: If you are not using {and} in if clause then you can write
only one statement. Otherwise it will cause of compilation error: Misplace
else
14. What will be output when you execute following C code?
#include<stdio.h>
void main(){
int a=2;
if(a--,--a,a)
printf("I am Good");
else
printf("You are Good");
}
A) I am Good
B) You are Good
C) Compilation error: Multiple parameters in
if statement
D) Run Time Error
Answer: B
Explanation: Consider the following expression:
a-- , --a , a
In C language, comma behaves as separator as well as operator. In the
above expression comma is behaving as operator. Comma operator
enjoys least precedence in precedence table and its associativity is left to
right. So first of all left most comma operator will perform operation
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
then right most comma will operator in the above expression.
After performing a-- : a will be 2
After performing --a : a will be 0
a=0
As we know in C language, zero represents false and any non-zero
number represents true. Hence else part will execute. 
15. What will be output when you execute following C code?
#include<stdio.h>
void main(){
int x=1,y=-1,z =0,;
if(x==y)
printf("Equal");
else
printf("Not Equal");
if(z)
printf("True");
else
printf("False");
}
A) Equal True
B) Not Equal True
C) Not Equal False
D) Equal False
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
Answer: C 
16. What will be output when you will execute following C code?
#include<stdio.h>
void main(){
int check=2;
switch(check){
case 1: printf("Sachin");
case 2: printf("Dravid");
case 3: printf("Lakshman");
default: printf("Dhoni");
}
}
A) Dravid
B) Dhoni
C) Dravid, Lakshman, Dhoni
D) Compilation Error
E) Sachin, Dravid, Lakshman, Dhoni
Answer: C
Explanation: Execute from second case statement. As we don’t have
break statement all other statements will execute.
17. The unused memory is released by using
A) release
B) free
C) malloc
D) None of the above
Ans: B 
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
18. What will be output when you will execute following C code?
#include<stdio.h>
void main(){
int x = 0;
for (x=1; x<4; x++);
printf("x=%dn", x);
}
A) X= 0,X= 1,X= 2,X= 3, X=4
B) X= 1,X= 2,X= 3, X=4, X=5
C) X=0
D) X=4
E) X =5
Answer: E 
 
Explanation: for loop have; at it’s end. So printf function is not under
for loop. So prints 5.
 
19. int x; /* assume x is 16 bits in size */
What is the maximum number that can be printed using
printf("%dn", x), assuming that x is initialized as shown above?
A) 127
B) 128
C) 32768
D) 32767
E) 65536
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
Answer: D
Explanation:
Range of int = 2 Byte
2 Bytes = 2*8 Bits 16 Bits
1 bit for sign, so 16-1 = 15. 
-2^15 to 2^15 -1 (-1 because including 0)
20. What will be output when you will execute following C code?
#include<stdio.h>
void main()
{
int s=0;
while(++s<10)
{
if(s<4 && s<9)
continue;
printf("n%dt",s);
}
}
A) 1 2 3 4 5 6 7 8 9
B) 1 2 3 10
C) 4 5 6 7 8 9 10
D) 4 5 6 7 8 9
E) 5 6 7 8 9
Answer: D
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
21. What will be output when you will execute following C code?
#include<stdio.h>
void main()
{
int s=0;
while(s++<10)
{
if(s<4 && s<9)
continue;
printf("n%dt",s);
}
}
A) 1 2 3 4 5 6 7 8 9
B) 1 2 3 10
C) 4 5 6 7 8 9 10
D) 4 5 6 7 8 9
E) 5 6 7 8 9
Answer: C
Explanation:
At While loop Starting the value of S is 0 only…in next step it is 1. Like
that it if s = 9 then while(S++<10) will execute first and in block of the
loop the value become 10. So print Even 10. 
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
22. What will be output when you execute following C code?
#include<stdio.h>
void main()
{
int s=0;
while(++s<10)
{
if(s<4 && s<9)
continue;
printf("n%dt",s);
}
}
A) 1 2 3 4 5 6 7 8
B) 1 2 3 10
C) 4 5 6 7 8 9 10
D) 4 5 6 7 8 9
E) 5 6 7 8 9
Answer: D
23. What will be output when you execute following C code?
#include<stdio.h>
void main()
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
{
int s=0;
while(s<10)
{ (s++<4)
continue;
printf("n%dt",s);
}
}
A) 1 2 3 4 5 6 7 8 9
B) 1 2 3 10
C) 4 5 6 7 8 9 10
D) 5 6 7 8 9 10
E) 5 6 7 8 9
Answer: D
24. What will be output when you will execute following C code?
void main()
{
int a=10,b=20;
char x=1,y=0;
if(a,b,x,y)
{
printf("EXAM");
}
}
A) EXAM
B) 0
C) Nothing will be printed.
D) Compilation Error
Answer: C
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
25. What will be output if you will compile and execute the following C
code?
#define x 5+2
void main(){
int i;
i=x*x*x;
printf("%d",i);
}
A) 125
B) 27
C) 8
D) 343
Answer: B
Explanation: As we know #define is token pasting preprocessor it only
paste the value of micro constant in the program before the actual
compilation start.
You can absorb #define only pastes the 5+2 in place of x in program. So,
i=5+2*5+2*5+2
=5+10+10+2
=27
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
26. What will be output if you compile and execute the following C
code?
void main(){
int i=10;
static int x=i;
if(x==i)
printf("Equal");
else if(x>i)
printf("Greater than");
else
printf("Less than");
}
A) Equal
B) Greater than
C) Less than
D) Compiler Error
Answer: D
Explanation: static variables are load time entity while auto variables are
run time entity. We cannot initialize any load time variable by the run
time variable.
In this example i is run time variable while x is load time variable.
27. What will be output if you execute following C code?
#include<stdio.h>
int main(){
int i;
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
for(i=0;i<5;i++){
int i=10;
printf(" %d",i);
i++;
}
return 0;
}
A) Compilation Error
B) 10 11 12 13 14
C) 10 10 10 10 10
D) 0 1 2 3 4 5
Answer: C
Explanation: Local variable is more precious than global.
28. What will be output of following program?
#include<stdio.h>
void main(){
int i = 5 , j;
int *p , *q;
p = &i;
q = &j;
j = 5;
printf("value of i : %d value of j : %d",*p,*q);
getch();
}
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
A) 5 5
B) Address Address
C) 5 Address
D) Compilation Error
E) Run Time Error
Answer: A
Explanation: P is pointer variable stores the address location of an
integer variable. Like that q as well.
29. What is the output of the following program?
#include<stdio.h>
void main(){
int *p1;
long double *p2;
printf("%d %d",sizeof(p1),sizeof(p2));
}
A) 2 4
B) 2 8
C) 2 2
D)4 4
Answer: C
Explanation: Size of any type of pointer is independent of the data type
which is it is pointing i.e. size of pointer is always fixed. Size of any type
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
(near) of pointer in C language is two byte.
Since both pointers int and long double are pointing to only first byte of int
data and long double data respectively.
Hence both int pointer and long double pointer stores only address in 16
bits. Thus both of them will occupy exactly equal memory space.
30. What will be output of following program?
#include<stdio.h>
void main(){
int a = 10;
void *p = &a;
int *ptr = p;
printf("%u",*ptr);
getch();
}
A) Compilation Error
B) 10
C) Address
D) Run Time Error
E) 2
Answer: B
Explanation: Void pointer can hold address of any data type without
type casting. Any pointer can hold void pointer without type casting.
31. What will be output of following program?
#include<stdio.h>
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
void main
int i = 3
int *j;
int **k;
j=&i;
k=&j;
printf(“%
}
A) 2 2 2
B) Addres
C) Addres
D) 3 3 3
Answer: B
Explanat
Here 6024
Value of k
n(){
3;
%u %u %d
2
ss Address
ss 3 3
3
B
tion: Memo
4, 8085, 909
k is content
d ”,k,*k,**k
3
ory represe
91 is any ar
t of k in me
k);
entation
rbitrary add
emory whic
dress, it ma
ch is 8085.
ay be differeent.
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
Value of *k means content of memory location which address k keeps.
k keeps address 8085 .
Content of at memory location 8085 is 6024
In the same way **k will equal to 3.
Short cut way to calculate:
Rule: * and & always cancel to each other
i.e. *&a = a
So *k = *(&j) since k = &j
*&j = j = 6024
And
**k = **(&j) = *(*&j) = *j = *(&i) = *&i = i = 3
32. What will be output of following program?
#include<stdio.h>
#include<string.h>
void main(){
register a = 25;
int *p;
p=&a;
printf("%d ",*p);
getch();
}
A) 25
B) 4
C) Address
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
D) Compilation Error
Answer: D
Explanation: Register data type stores in CPU. So it has not any
memory address. Hence we cannot write &a.
33. What will be output of following program?
#include<stdio.h>
void main(){
int i = 5;
int *p;
p = &i;
printf(" %u %u", *&p , &*p);
getch();
}
A) 5 Address
(B) Address Address
(C) Address 5
(D) Compilation error
(E) None of above
Answer: B
Explanation:
Since * and & always cancel to each other.
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
i.e. *&a = a
so *&p = p which store address of integer i
&*p = &*(&i) //since p = &i
= &(*&i)
= &i
So second output is also address of i.
34. What will be output of following program?
#include<stdio.h>
void main(){
int i = 100;
printf("value of i : %d addresss of i : %u",i,&i);
i++;
printf("nvalue of i : %d addresss of i : %u",i,&i);
getch();
}
(A)
value of i : 100 addresss of i : Address
value of i : 101 addresss of i : Address
(B)
value of i : 100 addresss of i : Address
value of i : 100 addresss of i : Address
(C) value of i : 101 addresss of i : Address
value of i : 101 addresss of i : Address
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
(D) Compilation error
(E) None of above
Answer: A
Explanation:
Within the scope of any variable, value of variable may change but its
address will never change in any modification of variable.
35. What will be output of following program?
#include<stdio.h>
void main(){
int i = 3;
int *j;
int **k;
j = &i;
k = &j;
printf(“%u %u %u”,i,j,k);
}
(A) 3 Address 3
(B) 3 Address Address
(C) 3 3 3
(D) Compilation error
(E) None of above
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
36.
Answer:
Explanat
ere 6024, 8
What will
void main
int
ptr
prin
}
A) 10
B) 10
C) 10
D) Co
Answer: C
Explanat
Address +
B
tion:
8085, 9091
l be outpu
n(){
*ptr=( int
=ptr+1;
ntf(" %u"
000
001
002
ompilatatio
C
tion:
+ Number=
is any arbi
ut of follow
t *)1000;
",ptr);
on Error
= Address
itrary addre
wing progr
ess, it may b
ram?
be differennt.
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
Address - Number= Address
Address++ = Address
Address-- = Address
++Address = Address
--Address = Address
If we will add or subtract a number from an address result will also be an
address.
New address will be:
37. What will be output of following C program?
void main(){
double *p=(double *)1000;
p=p+3;
printf(" %u",p);
}
A) 1000
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
B) 1002
C) 1024
D) 1003
E) Compilation Error
Answer: C
Explanation: 1000+3*8 Bytes
38. What will be output of following C program?
int *call();
void main(){
int *ptr;
ptr=call();
clrscr();
printf("%d",*ptr);
}
int * call(){
int x=25;
++x;
return &x;
}
Output: Garbage value.
Explanation: Variable x is local variable. Its scope and lifetime is within
the function call hence after returning address of x variable x became
dead and pointer is still pointing ptr is still pointing to that location.
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com
Solution of this problem: Make the variable x is as static variable.
In other word we can say a pointer whose pointing object has been
deleted is called dangling pointer.
39. What is Dangling pointer?
If any pointer is pointing the memory address of any variable but after
some variable has deleted from that memory location while pointer is still
pointing such memory location. Such pointer is known as dangling
pointer and this problem is known as dangling pointer problem.
Initially:
Later:
 
www.sakshieducation.com
www.sakshieducation.com
w
w
w
.sakshieducation.com

More Related Content

What's hot

Technical aptitude Test 1 CSE
Technical aptitude Test 1 CSETechnical aptitude Test 1 CSE
Technical aptitude Test 1 CSESujata Regoti
 
Technical aptitude test 2 CSE
Technical aptitude test 2 CSETechnical aptitude test 2 CSE
Technical aptitude test 2 CSESujata Regoti
 
02 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_0202 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_02Pooja Gupta
 
Chapter 4 : Balagurusamy Programming ANSI in C
Chapter 4 : Balagurusamy Programming ANSI in CChapter 4 : Balagurusamy Programming ANSI in C
Chapter 4 : Balagurusamy Programming ANSI in CBUBT
 
Chapter 5 Balagurusamy Programming ANSI in c
Chapter 5 Balagurusamy Programming ANSI  in cChapter 5 Balagurusamy Programming ANSI  in c
Chapter 5 Balagurusamy Programming ANSI in cBUBT
 
Chapter 5 exercises Balagurusamy Programming ANSI in c
Chapter 5 exercises Balagurusamy Programming ANSI  in cChapter 5 exercises Balagurusamy Programming ANSI  in c
Chapter 5 exercises Balagurusamy Programming ANSI in cBUBT
 
Chapter 2 : Balagurusamy_ Programming ANsI in C
Chapter 2 :  Balagurusamy_ Programming ANsI in CChapter 2 :  Balagurusamy_ Programming ANsI in C
Chapter 2 : Balagurusamy_ Programming ANsI in CBUBT
 
Write a program to check a given number is prime or not
Write a program to check a given number is prime or notWrite a program to check a given number is prime or not
Write a program to check a given number is prime or notaluavi
 
Chapter 6 Balagurusamy Programming ANSI in c
Chapter 6  Balagurusamy Programming ANSI  in cChapter 6  Balagurusamy Programming ANSI  in c
Chapter 6 Balagurusamy Programming ANSI in cBUBT
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given numberMainak Sasmal
 
B.Com 1year Lab programs
B.Com 1year Lab programsB.Com 1year Lab programs
B.Com 1year Lab programsPrasadu Peddi
 
Core programming in c
Core programming in cCore programming in c
Core programming in cRahul Pandit
 
Chapter 3 : Balagurusamy Programming ANSI in C
Chapter 3 : Balagurusamy Programming ANSI in C Chapter 3 : Balagurusamy Programming ANSI in C
Chapter 3 : Balagurusamy Programming ANSI in C BUBT
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given numberMainak Sasmal
 
Programming with c language practical manual
Programming with c language practical manualProgramming with c language practical manual
Programming with c language practical manualAnil Bishnoi
 
Programming fundamental 02
Programming fundamental 02Programming fundamental 02
Programming fundamental 02Suhail Akraam
 

What's hot (20)

Technical aptitude Test 1 CSE
Technical aptitude Test 1 CSETechnical aptitude Test 1 CSE
Technical aptitude Test 1 CSE
 
Technical aptitude test 2 CSE
Technical aptitude test 2 CSETechnical aptitude test 2 CSE
Technical aptitude test 2 CSE
 
02 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_0202 iec t1_s1_oo_ps_session_02
02 iec t1_s1_oo_ps_session_02
 
Ansi c
Ansi cAnsi c
Ansi c
 
Chapter 4 : Balagurusamy Programming ANSI in C
Chapter 4 : Balagurusamy Programming ANSI in CChapter 4 : Balagurusamy Programming ANSI in C
Chapter 4 : Balagurusamy Programming ANSI in C
 
Unit i intro-operators
Unit   i intro-operatorsUnit   i intro-operators
Unit i intro-operators
 
Chapter 5 Balagurusamy Programming ANSI in c
Chapter 5 Balagurusamy Programming ANSI  in cChapter 5 Balagurusamy Programming ANSI  in c
Chapter 5 Balagurusamy Programming ANSI in c
 
Chapter 5 exercises Balagurusamy Programming ANSI in c
Chapter 5 exercises Balagurusamy Programming ANSI  in cChapter 5 exercises Balagurusamy Programming ANSI  in c
Chapter 5 exercises Balagurusamy Programming ANSI in c
 
Chapter 2 : Balagurusamy_ Programming ANsI in C
Chapter 2 :  Balagurusamy_ Programming ANsI in CChapter 2 :  Balagurusamy_ Programming ANsI in C
Chapter 2 : Balagurusamy_ Programming ANsI in C
 
Write a program to check a given number is prime or not
Write a program to check a given number is prime or notWrite a program to check a given number is prime or not
Write a program to check a given number is prime or not
 
Chapter 6 Balagurusamy Programming ANSI in c
Chapter 6  Balagurusamy Programming ANSI  in cChapter 6  Balagurusamy Programming ANSI  in c
Chapter 6 Balagurusamy Programming ANSI in c
 
C important questions
C important questionsC important questions
C important questions
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
 
B.Com 1year Lab programs
B.Com 1year Lab programsB.Com 1year Lab programs
B.Com 1year Lab programs
 
Core programming in c
Core programming in cCore programming in c
Core programming in c
 
Chapter 3 : Balagurusamy Programming ANSI in C
Chapter 3 : Balagurusamy Programming ANSI in C Chapter 3 : Balagurusamy Programming ANSI in C
Chapter 3 : Balagurusamy Programming ANSI in C
 
Practical write a c program to reverse a given number
Practical write a c program to reverse a given numberPractical write a c program to reverse a given number
Practical write a c program to reverse a given number
 
Programming with c language practical manual
Programming with c language practical manualProgramming with c language practical manual
Programming with c language practical manual
 
Programming fundamental 02
Programming fundamental 02Programming fundamental 02
Programming fundamental 02
 
CP Handout#6
CP Handout#6CP Handout#6
CP Handout#6
 

Viewers also liked

Taller a ONG. Encuentro Trata Tráfico Ecuador Mayo 2012
Taller a ONG. Encuentro Trata Tráfico Ecuador Mayo 2012Taller a ONG. Encuentro Trata Tráfico Ecuador Mayo 2012
Taller a ONG. Encuentro Trata Tráfico Ecuador Mayo 2012ProyectoLIBERA
 
Finance Roadmap example
Finance Roadmap exampleFinance Roadmap example
Finance Roadmap exampleKim Masters
 
Seminar: Entwicklungs- und Konstruktionsmanagement 4.0 - Der E+K-Leiter im Sp...
Seminar: Entwicklungs- und Konstruktionsmanagement 4.0 - Der E+K-Leiter im Sp...Seminar: Entwicklungs- und Konstruktionsmanagement 4.0 - Der E+K-Leiter im Sp...
Seminar: Entwicklungs- und Konstruktionsmanagement 4.0 - Der E+K-Leiter im Sp...stzepm
 
MGS_Presentation_July_2014_lowres
MGS_Presentation_July_2014_lowresMGS_Presentation_July_2014_lowres
MGS_Presentation_July_2014_lowresAndrew Hale
 
Taller mauricio martinez
Taller mauricio martinezTaller mauricio martinez
Taller mauricio martinezjaimesr
 
Realidades de la vivienda popular que no se abordan con seriedad en Medellín,...
Realidades de la vivienda popular que no se abordan con seriedad en Medellín,...Realidades de la vivienda popular que no se abordan con seriedad en Medellín,...
Realidades de la vivienda popular que no se abordan con seriedad en Medellín,...AsociaTécnicos
 
Formulario de reembolso_dkv
Formulario de reembolso_dkvFormulario de reembolso_dkv
Formulario de reembolso_dkvFisiomechanics
 
Will there be a hard phone?
Will there be a hard phone?Will there be a hard phone?
Will there be a hard phone?arjunrc
 
Edoradca - fundusze unijne w woj. pomorskim
Edoradca - fundusze unijne w woj. pomorskimEdoradca - fundusze unijne w woj. pomorskim
Edoradca - fundusze unijne w woj. pomorskimMaciej Grzybowski
 
LEONES - Organización Distrito H-3 y Multiple H
LEONES - Organización Distrito H-3 y Multiple HLEONES - Organización Distrito H-3 y Multiple H
LEONES - Organización Distrito H-3 y Multiple HAldo Tinoco Plasencia
 
Colors of Nature
Colors of NatureColors of Nature
Colors of NatureKaren C
 
COMO HACER UN EPI
COMO HACER UN EPI COMO HACER UN EPI
COMO HACER UN EPI angelsmir1
 
Notas de hidrologia
Notas de hidrologiaNotas de hidrologia
Notas de hidrologiaNOE
 
Abrir php myadmin
Abrir php myadminAbrir php myadmin
Abrir php myadminchabbeine
 

Viewers also liked (20)

Taller a ONG. Encuentro Trata Tráfico Ecuador Mayo 2012
Taller a ONG. Encuentro Trata Tráfico Ecuador Mayo 2012Taller a ONG. Encuentro Trata Tráfico Ecuador Mayo 2012
Taller a ONG. Encuentro Trata Tráfico Ecuador Mayo 2012
 
Finance Roadmap example
Finance Roadmap exampleFinance Roadmap example
Finance Roadmap example
 
Seminar: Entwicklungs- und Konstruktionsmanagement 4.0 - Der E+K-Leiter im Sp...
Seminar: Entwicklungs- und Konstruktionsmanagement 4.0 - Der E+K-Leiter im Sp...Seminar: Entwicklungs- und Konstruktionsmanagement 4.0 - Der E+K-Leiter im Sp...
Seminar: Entwicklungs- und Konstruktionsmanagement 4.0 - Der E+K-Leiter im Sp...
 
Look
LookLook
Look
 
Segundo C
Segundo CSegundo C
Segundo C
 
MGS_Presentation_July_2014_lowres
MGS_Presentation_July_2014_lowresMGS_Presentation_July_2014_lowres
MGS_Presentation_July_2014_lowres
 
Rc nr 123_martie_2016
Rc nr 123_martie_2016Rc nr 123_martie_2016
Rc nr 123_martie_2016
 
Taller mauricio martinez
Taller mauricio martinezTaller mauricio martinez
Taller mauricio martinez
 
Realidades de la vivienda popular que no se abordan con seriedad en Medellín,...
Realidades de la vivienda popular que no se abordan con seriedad en Medellín,...Realidades de la vivienda popular que no se abordan con seriedad en Medellín,...
Realidades de la vivienda popular que no se abordan con seriedad en Medellín,...
 
Formulario de reembolso_dkv
Formulario de reembolso_dkvFormulario de reembolso_dkv
Formulario de reembolso_dkv
 
Will there be a hard phone?
Will there be a hard phone?Will there be a hard phone?
Will there be a hard phone?
 
Edoradca - fundusze unijne w woj. pomorskim
Edoradca - fundusze unijne w woj. pomorskimEdoradca - fundusze unijne w woj. pomorskim
Edoradca - fundusze unijne w woj. pomorskim
 
85 t00168 pdf
85 t00168 pdf85 t00168 pdf
85 t00168 pdf
 
LEONES - Organización Distrito H-3 y Multiple H
LEONES - Organización Distrito H-3 y Multiple HLEONES - Organización Distrito H-3 y Multiple H
LEONES - Organización Distrito H-3 y Multiple H
 
Colors of Nature
Colors of NatureColors of Nature
Colors of Nature
 
Katja Hansen EPEA / EUR on Cradle to Cradle
Katja Hansen EPEA / EUR on Cradle to CradleKatja Hansen EPEA / EUR on Cradle to Cradle
Katja Hansen EPEA / EUR on Cradle to Cradle
 
COMO HACER UN EPI
COMO HACER UN EPI COMO HACER UN EPI
COMO HACER UN EPI
 
Notas de hidrologia
Notas de hidrologiaNotas de hidrologia
Notas de hidrologia
 
Abrir php myadmin
Abrir php myadminAbrir php myadmin
Abrir php myadmin
 
Frases filosoficas
Frases filosoficasFrases filosoficas
Frases filosoficas
 

Similar to C language questions_answers_explanation

C multiple choice questions and answers pdf
C multiple choice questions and answers pdfC multiple choice questions and answers pdf
C multiple choice questions and answers pdfchoconyeuquy
 
Understand more about C
Understand more about CUnderstand more about C
Understand more about CYi-Hsiu Hsu
 
Computer programming chapter ( 4 )
Computer programming chapter ( 4 ) Computer programming chapter ( 4 )
Computer programming chapter ( 4 ) Ibrahim Elewah
 
Operators-computer programming and utilzation
Operators-computer programming and utilzationOperators-computer programming and utilzation
Operators-computer programming and utilzationKaushal Patel
 
important C questions and_answers praveensomesh
important C questions and_answers praveensomeshimportant C questions and_answers praveensomesh
important C questions and_answers praveensomeshpraveensomesh
 
C interview question answer 2
C interview question answer 2C interview question answer 2
C interview question answer 2Amit Kapoor
 
Python Unit 3 - Control Flow and Functions
Python Unit 3 - Control Flow and FunctionsPython Unit 3 - Control Flow and Functions
Python Unit 3 - Control Flow and FunctionsDhivyaSubramaniyam
 
Deep C Programming
Deep C ProgrammingDeep C Programming
Deep C ProgrammingWang Hao Lee
 
programs of c www.eakanchha.com
 programs of c www.eakanchha.com programs of c www.eakanchha.com
programs of c www.eakanchha.comAkanchha Agrawal
 
C aptitude.2doc
C aptitude.2docC aptitude.2doc
C aptitude.2docSrikanth
 

Similar to C language questions_answers_explanation (20)

C multiple choice questions and answers pdf
C multiple choice questions and answers pdfC multiple choice questions and answers pdf
C multiple choice questions and answers pdf
 
operators.ppt
operators.pptoperators.ppt
operators.ppt
 
C Programming
C ProgrammingC Programming
C Programming
 
Java Quiz
Java QuizJava Quiz
Java Quiz
 
Understand more about C
Understand more about CUnderstand more about C
Understand more about C
 
Aptitute question papers in c
Aptitute question papers in cAptitute question papers in c
Aptitute question papers in c
 
Computer programming chapter ( 4 )
Computer programming chapter ( 4 ) Computer programming chapter ( 4 )
Computer programming chapter ( 4 )
 
Programming in C
Programming in CProgramming in C
Programming in C
 
Operators-computer programming and utilzation
Operators-computer programming and utilzationOperators-computer programming and utilzation
Operators-computer programming and utilzation
 
important C questions and_answers praveensomesh
important C questions and_answers praveensomeshimportant C questions and_answers praveensomesh
important C questions and_answers praveensomesh
 
C interview question answer 2
C interview question answer 2C interview question answer 2
C interview question answer 2
 
Python Unit 3 - Control Flow and Functions
Python Unit 3 - Control Flow and FunctionsPython Unit 3 - Control Flow and Functions
Python Unit 3 - Control Flow and Functions
 
Arithmetic operator
Arithmetic operatorArithmetic operator
Arithmetic operator
 
Technical questions
Technical questionsTechnical questions
Technical questions
 
Deep C Programming
Deep C ProgrammingDeep C Programming
Deep C Programming
 
programs of c www.eakanchha.com
 programs of c www.eakanchha.com programs of c www.eakanchha.com
programs of c www.eakanchha.com
 
Exam for c
Exam for cExam for c
Exam for c
 
C aptitude.2doc
C aptitude.2docC aptitude.2doc
C aptitude.2doc
 
Captitude 2doc-100627004318-phpapp01
Captitude 2doc-100627004318-phpapp01Captitude 2doc-100627004318-phpapp01
Captitude 2doc-100627004318-phpapp01
 
UNIT-II CP DOC.docx
UNIT-II CP DOC.docxUNIT-II CP DOC.docx
UNIT-II CP DOC.docx
 

Recently uploaded

KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 

Recently uploaded (20)

KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 

C language questions_answers_explanation

  • 1. C Language Bit Bank 1. What will be output of the following C program? #include<stdio.h> int main(){ int goto=5; printf("%d",goto); return 0; } A) 5 B) 0 C) 1 D) Compilation Error E) 4 Answer: D Explanation: Invalid variable name. goto is keyword in C language. Variable name cannot be a keyword of C language. 2. What will be output of the following C program? #include<stdio.h> int xyz=10; int main(){ int xyz=20; printf("%d",xyz); return 0; } www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 2. A) 10 B) 20 C) 0 D) Compilation Error Answer: B Explanation: Two variables can have same name in different scopes. Local Scope is superior to Global scope. 3. What will be output of the following C program? #include<stdio.h> int main(){ int main = 80; printf("%d",main); return 0; } A) Compilation Error B) 80 C) 0 D) Garbage Value Answer: B Explanation: Variable name can be main, which is a function and it is not a keyword.   4. What will be output of the following program? #include<stdio.h> int main(){ int a=5,b = 6; www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 3. swap( a, b); printf("%d %d",a,b); return 0; } void swap(int a , int b){ int temp = a; a= b; b = temp; } A) 6 5 B) 5 6 C) Garbage Value 5 D) 5 Garbage value E) No output Answer: B Explanation: Scope of a, b is within the function. So, no swap happened to variables. If you required swapping, you have to swap their addresses. www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 4. 5. What will be output of the following program? #include<stdio.h> int main(){ int i=1; i=2+2*i++; printf("%d",i); return 0; } A) 5 B) 6 C) 8 D) 4 Answer: A Explanation: i++ i.e. when postfix increment operator is used in any expression, it first assigns its value in the expression then it increments the value of variable by one. So, i = 2 + 2 * 1 i = 4 Now i will be incremented by one so that i = 4 + 1 = 5. 6. What will be output of the following program? #include<stdio.h> int main(){ int i=5,j; j=++i+++i+++i; www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 5. printf("%d %d",i,j); return 0; } A) 5 20 B) 5 18 C) Compilation Error D) 8 24 E) 6 24 Answer: D Output: 8 24 Explanation: Rule : ++ is pre increment operator. So in any arithmetic expression it first increments the value of variable by one in whole expression, then starts assigning the final value of variable in the expression. Compiler will treat the expression j = ++i+++i+++i; as i = ++i + ++i + ++i; Initial value of i = 5 due to three pre increment operator final value of i=8. Now final value of i i.e. 8 will be assigned to each variable as shown in www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 6. 7. the follow So, j=8+8 j=24 and i=8 What will #include void main int a=5 if(a&&b prin } else{ } } wing figure: 8+8 l be outpu <stdio.h> n(){ 5,b=2,c=2; b<c++){ tf("TRUE" printf("FA ut when yo "); ALSE"); ou executee the followwing C codde? www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 7. A) TRUE B) FALSE C) Compilation Error D) Run time error Answer: B 8. What will be output when you execute following C code? #include<stdio.h> void main(){ int a=5,b=10,c=1; if(a&&b>c){ printf("SAKSHI BITBANK"); } else{ break; } } A) SAKSHI BITBANK B) Print Nothing C) Compilation Error Answer: C Explanation: Keyword break is not syntactical part of if-else statement. So we cannot use break keyword in if-else statement. This keyword can be used in case of loop or switch case statement. Hence when you will compile, above code compiler will show an error message: Misplaced break. www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 8. 9. What will be output when you execute following C code? #include<stdio.h> void main(){ int a=5,b=10; if(++a||++b) printf("%d %d",a,b); else printf("HTST Quiz"); } A) 5 10 B) 6 10 C) 6 11 D) 5 11 E) HTST Quiz Answer: B Explanation: Consider the following expression: ++a || ++b In this expression || is Logical OR operator. Two important properties of this operator are: Property 1: (Expression1) || (Expression2) || operator returns 0 if and only if both expressions return a zero otherwise it || operator returns 1. www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 9. Property 2: To optimize the execution time there is rule, Expression2 will only evaluate if and only if Expression1 return zero. In this program initial value of a is 5. So ++a will be 6. Since ++a is returning a non-zero so ++b will not execute and if condition will be true and if clause will be executed. 10. What is output of the following program? #include<stdio.h> void main(){ int a=5,b=10; if(++a && ++b) printf("%d %d",a,b); else printf("Sakshi"); } A) 5 10 B) 6 10 C) 6 11 D) 5 11 E) Sakshi Answer: C Explanation: Consider the following expression: ++a && ++b In this expression && is Logical AND operator. Two important properties of this operator are: www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 10. Property 1: (Expression1) && (Expression2) && operator returns 0 either of the expressions return a zero. Property 2: Here Both expressions should evaluate not like previous, based on evaluation the result will display. So, both will evaluate. 11. What will be the output when the following C code is executed? #include<stdio.h> void main(){ int x=-1,y=-1; if(++x=++y) printf("DennisRitche"); else printf("JamesGosling"); } A) DennisRitche B) JamesGosling C) Warning: Condition is always true D) Compilation error Answer: D Explanation: Consider following statement: ++x=++y www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 11. As we know ++ is pre increment operator in the above statement. This operator increments the value of any integral variable by one and returns that value. After performing pre-increments, above statement will be: 0=0 In C language, it is illegal to assign a constant value to another constant. Left side of = operator must be a container i.e. a variable. So compiler will show an error message: L value required. If we want to make it true…we have to use == (Equal to operator) = is assignment operator. 12. What will be output when you will execute following C code? #include<stdio.h> void main(){ if(0xA) if(052) if('xeb') if('012') printf("SAKSHI EDUCATION"); else; else; else; else; } A)SAKSHI EDUCATION B)Print Nothing C)Compilation error: Misplaced else D)Compilation error: If without any body www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 12. E)Compilation error: Undefined symbol Answer: A Explanation: oxA: It is hexadecimal integer constant. 052: It octal integer constant. ‘xeb’: It is hexadecimal character constant. ‘012’: It is octal character constant. As we know in C language, zero represents false and any non-zero number represents true. All of the above constants return a non-zero value. So all if conditions in the above program are true. In C, it is possible to write else clause without any body. 13. What will be output when you will execute following C code? #include<stdio.h> void main(){ int x=1; if(x--) printf("X = %d"+x); --x; else printf("%d",x); } A) 0 B) 1 www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 13. C) Compilation Error D) -1 Answer: C Explanation: If you are not using {and} in if clause then you can write only one statement. Otherwise it will cause of compilation error: Misplace else 14. What will be output when you execute following C code? #include<stdio.h> void main(){ int a=2; if(a--,--a,a) printf("I am Good"); else printf("You are Good"); } A) I am Good B) You are Good C) Compilation error: Multiple parameters in if statement D) Run Time Error Answer: B Explanation: Consider the following expression: a-- , --a , a In C language, comma behaves as separator as well as operator. In the above expression comma is behaving as operator. Comma operator enjoys least precedence in precedence table and its associativity is left to right. So first of all left most comma operator will perform operation www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 14. then right most comma will operator in the above expression. After performing a-- : a will be 2 After performing --a : a will be 0 a=0 As we know in C language, zero represents false and any non-zero number represents true. Hence else part will execute.  15. What will be output when you execute following C code? #include<stdio.h> void main(){ int x=1,y=-1,z =0,; if(x==y) printf("Equal"); else printf("Not Equal"); if(z) printf("True"); else printf("False"); } A) Equal True B) Not Equal True C) Not Equal False D) Equal False www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 15. Answer: C  16. What will be output when you will execute following C code? #include<stdio.h> void main(){ int check=2; switch(check){ case 1: printf("Sachin"); case 2: printf("Dravid"); case 3: printf("Lakshman"); default: printf("Dhoni"); } } A) Dravid B) Dhoni C) Dravid, Lakshman, Dhoni D) Compilation Error E) Sachin, Dravid, Lakshman, Dhoni Answer: C Explanation: Execute from second case statement. As we don’t have break statement all other statements will execute. 17. The unused memory is released by using A) release B) free C) malloc D) None of the above Ans: B  www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 16. 18. What will be output when you will execute following C code? #include<stdio.h> void main(){ int x = 0; for (x=1; x<4; x++); printf("x=%dn", x); } A) X= 0,X= 1,X= 2,X= 3, X=4 B) X= 1,X= 2,X= 3, X=4, X=5 C) X=0 D) X=4 E) X =5 Answer: E    Explanation: for loop have; at it’s end. So printf function is not under for loop. So prints 5.   19. int x; /* assume x is 16 bits in size */ What is the maximum number that can be printed using printf("%dn", x), assuming that x is initialized as shown above? A) 127 B) 128 C) 32768 D) 32767 E) 65536 www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 17. Answer: D Explanation: Range of int = 2 Byte 2 Bytes = 2*8 Bits 16 Bits 1 bit for sign, so 16-1 = 15.  -2^15 to 2^15 -1 (-1 because including 0) 20. What will be output when you will execute following C code? #include<stdio.h> void main() { int s=0; while(++s<10) { if(s<4 && s<9) continue; printf("n%dt",s); } } A) 1 2 3 4 5 6 7 8 9 B) 1 2 3 10 C) 4 5 6 7 8 9 10 D) 4 5 6 7 8 9 E) 5 6 7 8 9 Answer: D www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 18. 21. What will be output when you will execute following C code? #include<stdio.h> void main() { int s=0; while(s++<10) { if(s<4 && s<9) continue; printf("n%dt",s); } } A) 1 2 3 4 5 6 7 8 9 B) 1 2 3 10 C) 4 5 6 7 8 9 10 D) 4 5 6 7 8 9 E) 5 6 7 8 9 Answer: C Explanation: At While loop Starting the value of S is 0 only…in next step it is 1. Like that it if s = 9 then while(S++<10) will execute first and in block of the loop the value become 10. So print Even 10.  www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 19. 22. What will be output when you execute following C code? #include<stdio.h> void main() { int s=0; while(++s<10) { if(s<4 && s<9) continue; printf("n%dt",s); } } A) 1 2 3 4 5 6 7 8 B) 1 2 3 10 C) 4 5 6 7 8 9 10 D) 4 5 6 7 8 9 E) 5 6 7 8 9 Answer: D 23. What will be output when you execute following C code? #include<stdio.h> void main() www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 20. { int s=0; while(s<10) { (s++<4) continue; printf("n%dt",s); } } A) 1 2 3 4 5 6 7 8 9 B) 1 2 3 10 C) 4 5 6 7 8 9 10 D) 5 6 7 8 9 10 E) 5 6 7 8 9 Answer: D 24. What will be output when you will execute following C code? void main() { int a=10,b=20; char x=1,y=0; if(a,b,x,y) { printf("EXAM"); } } A) EXAM B) 0 C) Nothing will be printed. D) Compilation Error Answer: C www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 21. 25. What will be output if you will compile and execute the following C code? #define x 5+2 void main(){ int i; i=x*x*x; printf("%d",i); } A) 125 B) 27 C) 8 D) 343 Answer: B Explanation: As we know #define is token pasting preprocessor it only paste the value of micro constant in the program before the actual compilation start. You can absorb #define only pastes the 5+2 in place of x in program. So, i=5+2*5+2*5+2 =5+10+10+2 =27 www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 22. 26. What will be output if you compile and execute the following C code? void main(){ int i=10; static int x=i; if(x==i) printf("Equal"); else if(x>i) printf("Greater than"); else printf("Less than"); } A) Equal B) Greater than C) Less than D) Compiler Error Answer: D Explanation: static variables are load time entity while auto variables are run time entity. We cannot initialize any load time variable by the run time variable. In this example i is run time variable while x is load time variable. 27. What will be output if you execute following C code? #include<stdio.h> int main(){ int i; www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 23. for(i=0;i<5;i++){ int i=10; printf(" %d",i); i++; } return 0; } A) Compilation Error B) 10 11 12 13 14 C) 10 10 10 10 10 D) 0 1 2 3 4 5 Answer: C Explanation: Local variable is more precious than global. 28. What will be output of following program? #include<stdio.h> void main(){ int i = 5 , j; int *p , *q; p = &i; q = &j; j = 5; printf("value of i : %d value of j : %d",*p,*q); getch(); } www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 24. A) 5 5 B) Address Address C) 5 Address D) Compilation Error E) Run Time Error Answer: A Explanation: P is pointer variable stores the address location of an integer variable. Like that q as well. 29. What is the output of the following program? #include<stdio.h> void main(){ int *p1; long double *p2; printf("%d %d",sizeof(p1),sizeof(p2)); } A) 2 4 B) 2 8 C) 2 2 D)4 4 Answer: C Explanation: Size of any type of pointer is independent of the data type which is it is pointing i.e. size of pointer is always fixed. Size of any type www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 25. (near) of pointer in C language is two byte. Since both pointers int and long double are pointing to only first byte of int data and long double data respectively. Hence both int pointer and long double pointer stores only address in 16 bits. Thus both of them will occupy exactly equal memory space. 30. What will be output of following program? #include<stdio.h> void main(){ int a = 10; void *p = &a; int *ptr = p; printf("%u",*ptr); getch(); } A) Compilation Error B) 10 C) Address D) Run Time Error E) 2 Answer: B Explanation: Void pointer can hold address of any data type without type casting. Any pointer can hold void pointer without type casting. 31. What will be output of following program? #include<stdio.h> www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 26. void main int i = 3 int *j; int **k; j=&i; k=&j; printf(“% } A) 2 2 2 B) Addres C) Addres D) 3 3 3 Answer: B Explanat Here 6024 Value of k n(){ 3; %u %u %d 2 ss Address ss 3 3 3 B tion: Memo 4, 8085, 909 k is content d ”,k,*k,**k 3 ory represe 91 is any ar t of k in me k); entation rbitrary add emory whic dress, it ma ch is 8085. ay be differeent. www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 27. Value of *k means content of memory location which address k keeps. k keeps address 8085 . Content of at memory location 8085 is 6024 In the same way **k will equal to 3. Short cut way to calculate: Rule: * and & always cancel to each other i.e. *&a = a So *k = *(&j) since k = &j *&j = j = 6024 And **k = **(&j) = *(*&j) = *j = *(&i) = *&i = i = 3 32. What will be output of following program? #include<stdio.h> #include<string.h> void main(){ register a = 25; int *p; p=&a; printf("%d ",*p); getch(); } A) 25 B) 4 C) Address www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 28. D) Compilation Error Answer: D Explanation: Register data type stores in CPU. So it has not any memory address. Hence we cannot write &a. 33. What will be output of following program? #include<stdio.h> void main(){ int i = 5; int *p; p = &i; printf(" %u %u", *&p , &*p); getch(); } A) 5 Address (B) Address Address (C) Address 5 (D) Compilation error (E) None of above Answer: B Explanation: Since * and & always cancel to each other. www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 29. i.e. *&a = a so *&p = p which store address of integer i &*p = &*(&i) //since p = &i = &(*&i) = &i So second output is also address of i. 34. What will be output of following program? #include<stdio.h> void main(){ int i = 100; printf("value of i : %d addresss of i : %u",i,&i); i++; printf("nvalue of i : %d addresss of i : %u",i,&i); getch(); } (A) value of i : 100 addresss of i : Address value of i : 101 addresss of i : Address (B) value of i : 100 addresss of i : Address value of i : 100 addresss of i : Address (C) value of i : 101 addresss of i : Address value of i : 101 addresss of i : Address www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 30. (D) Compilation error (E) None of above Answer: A Explanation: Within the scope of any variable, value of variable may change but its address will never change in any modification of variable. 35. What will be output of following program? #include<stdio.h> void main(){ int i = 3; int *j; int **k; j = &i; k = &j; printf(“%u %u %u”,i,j,k); } (A) 3 Address 3 (B) 3 Address Address (C) 3 3 3 (D) Compilation error (E) None of above www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 31. 36. Answer: Explanat ere 6024, 8 What will void main int ptr prin } A) 10 B) 10 C) 10 D) Co Answer: C Explanat Address + B tion: 8085, 9091 l be outpu n(){ *ptr=( int =ptr+1; ntf(" %u" 000 001 002 ompilatatio C tion: + Number= is any arbi ut of follow t *)1000; ",ptr); on Error = Address itrary addre wing progr ess, it may b ram? be differennt. www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 32. Address - Number= Address Address++ = Address Address-- = Address ++Address = Address --Address = Address If we will add or subtract a number from an address result will also be an address. New address will be: 37. What will be output of following C program? void main(){ double *p=(double *)1000; p=p+3; printf(" %u",p); } A) 1000 www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 33. B) 1002 C) 1024 D) 1003 E) Compilation Error Answer: C Explanation: 1000+3*8 Bytes 38. What will be output of following C program? int *call(); void main(){ int *ptr; ptr=call(); clrscr(); printf("%d",*ptr); } int * call(){ int x=25; ++x; return &x; } Output: Garbage value. Explanation: Variable x is local variable. Its scope and lifetime is within the function call hence after returning address of x variable x became dead and pointer is still pointing ptr is still pointing to that location. www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com
  • 34. Solution of this problem: Make the variable x is as static variable. In other word we can say a pointer whose pointing object has been deleted is called dangling pointer. 39. What is Dangling pointer? If any pointer is pointing the memory address of any variable but after some variable has deleted from that memory location while pointer is still pointing such memory location. Such pointer is known as dangling pointer and this problem is known as dangling pointer problem. Initially: Later:   www.sakshieducation.com www.sakshieducation.com w w w .sakshieducation.com