Professional Documents
Culture Documents
MEMORY REPRESENTATION
The computer memory stores different kinds of data like input data, output data,
intermediate results, etc., and the instructions. Binary digit or bit is the basic unit
of memory.
A bit is a single binary digit, i.e., 0 or 1.
A bit is the smallest unit of representation of data in a computer. The data is
handled by the computer as a combination of bits.
A group of bytes can be further combined to form a word. A word can be a group
of 2, 4 or 8 bytes.
Memory Hierarchy
The memory is characterized on the basis of two key factors—
•Capacity - the amount of information (in bits) that a memory can store.
•access time - time interval between the read/ write request and the availability of data.
• The lesser the access time, the faster is the speed of memory.
We want the memory with fastest speed(lesser access time) and largest capacity.
MODULE 2
Rules FOR NAMING Identifiers
The rules for naming identifiers are as follows −
•Identifier names are unique.
•Cannot use a keyword as identifiers.
•Identifier has to begin with a letter or underscore (_).
•It should not contain white space.
•Special characters are not allowed.
•Identifiers can consist of only letters, digits, or underscore.
•Only 31 characters are significant.
•They are case sensitive.
Int A=2 Int A=2
B=A++ B=++A
B=2,A=3 B=3,A=3
4. Union:
• Structure and union are same but different in memory allocation.
• A union can be declared using the keyword is union.
• A union is a memory location that is shared by two or more
different variables, generally of different types at different times.
• Defining a union is similar to defining a structure.
STRUCT STUD{
Int rollno;
Float marks;
Char name[5];
}s; s.marks;
union STUD{
Int rollno;
Float marks;
Char name[8];
}s; s.marks;
N=5,
If X=++N we will get
X=6,N=6
If X=N++ we will get
X=5,N=6
Here x=n++,so
x=5,then y=-x=-5.S0
Ans:5,-5
Answer:c
Here, in (c)
a<b,so false valu will
execute,(b>c)?b:c
While checking
b=10,c=8,we will get
b>c,true form will
execute,so answer wll
get b=10C
Ans:C
22>17,so x+y,ie 37
SHORT S[5]-2*5=10
UNION
FLOAT Y-4,LONG-8
UNIN-8 BYTES
Do-while
INT X=4
CONST INT Y=6
Y++
COMPILATION ERROR
114 )answer C
115) Answer B.. Because others are sysytem softwares
116)Answer C..if conditin is true,first statement will
execute,othersise secnd
111)ans:- D
112)ans:-B
113) ANS:-B
114) ANS:-C
115)ans:-B
Here answer is A.
Explanation
Int i=10; //allocates a memory which contains 10
Printf(“%d%d%d",I,++I,I++);
Now, when printf contains multiple arguments then value is assigned from right to
left and printed from left to right.
So, I++=10 //the value of I=10 changes to 11 due to post increment.
Then, ++I=12 //the value of I=11 is pre incremented and changes tplo I=12;
Then, I =12 // now The memory block of I contains 12 only.
So the output should be 121210
#include <stdio.h>
int main(){
int a=10; Outut of this code is
printf("%d",a); 10 10 12
printf("%d",a++);
printf("%d",++a);
return 0;}
117 ans: C
119 ans:C
120 ans A
https://www.examtray.com/c-questions/c-mcq-questions-and-answers-functions-and-pointers-1
https://www.avatto.com/computer-science/test/mcqs/questions-answers/c/7/1.html