0% found this document useful (0 votes)
21 views

Study Material

The document contains a C program with multiple sections: 1) A program to print messages based on array size and bit values. 2) Multiple choice questions on C concepts like static variables and operators. 3) Technical interview questions on C topics like data structures, operators, endianess, etc.

Uploaded by

hajayanth2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Study Material

The document contains a C program with multiple sections: 1) A program to print messages based on array size and bit values. 2) Multiple choice questions on C concepts like static variables and operators. 3) Technical interview questions on C topics like data structures, operators, endianess, etc.

Uploaded by

hajayanth2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Program:

1) Declare globally an unsigned char array of framedata with size as framelength.


2) If the size of the array is greater than 50 then print”001:………….”otherwise
print”002:…………..”
3) If 6thbit is set in a 0th byte then print”even……..” otherwise print”odd…………….”
4) If 2nd byte is multiple of 49th byte then add 10 consecutive bytes.
5) If 7th bit is set then call normarray(unsigned *char,unsigned …………..)

Mutilpe choice questions

1) Main()
{
int i=10;
If(z=!(i>14))
Printf(“%d”,z);

}
2) static const int i=10;
main()
{
static int i=20;
printf(“%d”,i);
}

Technical round:

1)Print

**

***

****

*****

2) Addition of two numbers without using Arithmetic operators

3) if(?)

Printf(“Hello”);

Else

Printf(“world”);

o/p: HELLOWORLD

1) Is it possible
2) If possible write condition

4)Main()

Float a=5;

Switch(a)

Case 1:printf(“hi”);

Case 5:printf(“hello”);

5)WAP to set 5th bit in a byte but don’t disturb the lower nibble part.

6)structure padding

7)Differences b/w structure and union with an example

8)About projects in detail

9)storage classes in detail

10)Arrays,pointers,files

11)similar program in written test

12)compilation process

13)CAN protocol

14)Error frame in CAN

15)Interrupt Service Routine in 8051

16)operators in c explain in detail

17)list of data types with corresponding ranges

18)main()

Int a=10;b=20;

Func(a,b);

Printf(“%d %d”,a,b);

}
Func(int x, int y)

X=20;y=30;

o/p:x=?,y=?

19)main()

Int a=10;b=20;

Func(&a,&b);

Printf(“%d %d”,a,b);

Func(int *x, int *y)

X=20;y=30;

o/p:x=?,y=?

20)int x=0x12345678

If it is big endian what is the value of x?

If it is little endian what is the value of x?

21)Take 3 variables as x,y,z how do you know that whether 3 varaibles are equal or not?

22)greatest of three numbers

23)

struct xyz

Char

Int

Float

Double
Short int

Int

What is the size of the structure?

AVIN SYSTEM

1. main()
{
printf(“%x”,-1<<3);
}
2. struct employe
{
};
main(){
struct employes[10];
printf("%d",sizeof(s));
}

3. struct employe{
int day;
char name[];
int a;
int b;
}ss,ss2,ss1[10];

how many structure variable are created?


a. ss,ss2;
b. ss,ss2,ss1[0],,,ss1[9]
c. ss,ss2,ss1[10]
d. None

4. main(){
int n=5;
printf("%d",n--);
if(n)
main();
}
5. main()
{
printf("%c",10[AUTOMOTIVE]);
}
6. main()
{
char a=0x12345678;
char *ptr,ptr=&a;
printf("%x",*ptr++);
}

7. main()
{
int i=1;
switch(i);
{
printf("AVIN");
case 1:printf("AVIN");
case 2:printf("system");
break;
}
}
8. #define static_value 10
main()
{
static int x=10.01;
if(x==static_value)
printf("equal");
else if (x>10)
printf("not eql");
else
printf("not equal");
}

9. main(){
int i,j,k,l,m;
i=-1;j=-1;k=0;l=2;
m=i++&&j++&&k++||l++;
printf("%d%d%d%d%d",i,j,k,l,m);
}
10. main()
{
char str[]="WIN";
char* s=str;
for(i=1;str[i];i++)
{
printf("%c%c%c",s[i],*(s+i),i[s]);
}
}
11. main(){
int i=0,k=0;z=0;
z=++i||++k||z++;
printf("%d%d%",i,k,z);
}

-----------------------------------------------
12. main()
{
printf(“%x”,-1<<3);
}
13. struct employe
{
};
main(){
struct employes[10];
printf("%d",sizeof(s));
}

14. struct employe{


int day;
char name[];
int a;
int b;
}ss,ss2,ss1[10];

how many structure variable are created?


e. ss,ss2;
f. ss,ss2,ss1[0],,,ss1[9]
g. ss,ss2,ss1[10]
h. None

15. main(){
int n=5;
printf("%d",n--);
if(n)
main();
}
16. main()
{
printf("%c",10[AUTOMOTIVE]);
}
17. main()
{
char a=0x12345678;
char *ptr,ptr=&a; //Redeclaration of pointer hence Error
printf("%x",*ptr++);
}

18. main()
{
int i=1;
switch(i);
{
printf("AVIN");
case 1:printf("AVIN");
case 2:printf("system");
break;
}
}
19. #define static_value 10
main()
{
static int x=10.01;
if(x==static_value)
printf("equal");
else if (x>10)
printf("not eql");
else
printf("not equal");
}

20. main(){
int i,j,k,l,m;
i=-1;j=-1;k=0;l=2;
m=i++&&j++&&k++||l++;
printf("%d%d%d%d%d",i,j,k,l,m);
}
21. main()
{
char str[]="WIN";
char* s=str;
for(i=1;str[i];i++)
{
printf("%c%c%c",s[i],*(s+i),i[s]);
}
}
22. main(){
int i=0,k=0;z=0;
z=++i||++k||z++;
printf("%d%d%",i,k,z);
}

23. Main()
{
int i=10;
If(z=!(i>14))
Printf(“%d”,z);
}
24. static const int i=10;
main()
{
Static int i=20;
Printf(“%d”,i);
}

Technical round:
1. Print
*
**
***
****
*****
2. Addition of two numbers without using Arithmetic operators
3. if(?)
Printf(“Hello”);
Else
Printf(“world”);
o/p: HELLOWORLD
3) Is it possible
4) If possible write condition
4. main()
{
Float a=5;
Switch(a)
{
Case 1:printf(“hi”);
Case 5:printf(“hello”);
}

5. WAP to set 5th bit in a byte but don’t disturb the lower nibble part.
6. structure padding
7. Differences b/w structure and union with an example
8. About projects in detail
9. storage classes in detail
10. Arrays,pointers,files
11. similar program in written test
12. compilation process
13. CAN protocol
14. Error frame in CAN
15. Interrupt Service Routine in 8051
16. operators in c explain in detail
17. list of data types with corresponding ranges
18. main()
{
Int a=10;b=20;
Func(a,b);
Printf(“%d %d”,a,b);
}
Func(int x, int y)
{
X=20;y=30;
}
o/p:x=?,y=?
19. main()
{
Int a=10;b=20;
Func(&a,&b);
Printf(“%d %d”,a,b);
}
Func(int *x, int *y)
{
X=20;y=30;
}
o/p:x=?,y=?
20. int x=0x12345678
If it is big endian what is the value of x?
If it is little endian what is the value of x?
21. Take 3 variables as x,y,z how do you know that whether 3 varaibles are equal or not?
22. greatest of three numbers
23. struct xyz
{
Char
Int
Float
Double
Short int
Int
}
What is the size of the structure?

You might also like