You are on page 1of 11

OPERATORS

(A)ARITHMATICAL OPERATOR (B)RELATIONAL OPERATOR


x=30, y=20, z=10; FIND OUT THE VALUE FOR K x=10,y=20,z;
1)k = x + y * z / 4 % 2 - 1 ; 1)z= x<y;
2)k= x% y+z*z; 2)z= x>y;
3)k= x*x-y/z; 3)z=x<=y;
4)k= x+y/z-y; 4)z=(x*x-y)>(y*y-x);
5)k=x+y-(x=y); //y=? 5)z=(x*x*x)<(y*x*x);
6)k=x+y-x=y; //y=? 6)z=((x*y)!=(y*x));
7)z=((x*y)==(y*x));

(C)LOGICAL OPERATOR (D)BITWISE OPERATOR


FINDOUT THE VALUE FOR i,j,k int i=10,j=20,m=5,k;
int i=10,j=20,k; 1)k=i&j;
1)k=i&&j; 2)k=i|j;
2)k=i||j; 3)k=i^j;
3)k=!i; 4)k=i&&j|m&&j;
-------------------------------------------- 5)k=i||j&m&&i;
int i=10,j=0,k; 6)k=i&j|j||m;
4)k=i&&(j=20); int i=10,j=20,k=30;
5)k=i||(j=20); 7)k=i&&j&k;
8)k=i&j|k&&i;
int i=0,j=0,k=30,l; 9))k=i||j&j;
6)l=i||(j=20)&&k; 10)k=i||j&(j&&k);

int i=10,j=20,k=0,l;
7)l=i&&j||j&&k;
8)l=i||j&&i||k;

(E)INCREMENT AND DECREMENT (F)SHIFT OPERATOR


int i=10,j=50,k; int i=10,j=2,k;
1)k=++i+j++; //i=?,j=?,k=? 1)k=i<<j;
2)k=i++-++j; //i=?,j=?,k=? 2)k=i>>j;
3)k=(i--+ j++); //i=?,j=?,k=? 3)k=(i&&j)<<j;
4)k=(i||j)>>j;
5)k=(i&j)<<i;
6)k=(i||j&&i);

(G)ASSIGNMENT OPERATOR

1) SWAPPING OF TWO NUMBERS WITH USING THIRD VARIABLE

2) SWAPPING OF TWO NUMBERS WITHOUT USING THIRD VARIABLE


(H)CONDITIONAL OPERATOR

1) BIGGEST OF TWO NUMBERS USING CONDITIONAL OPERATOR

2) EVEN AND ODD NUMBER USING CONDITIONAL OPERATOR

3) POSITIVE OR NEGATIVE NUMBER USING CONDITIONAL OPERATOR

(I) BITWISE OPERATOR

1) HOW TO SET A BIT

2) HOW TO CLEAR A BIT

3) HOW TO COMPLIMENT A BIT

4) GIVEN NUMBER IS POWER OF 2 OR NOT

(J) SIZEOF OPERATOR

(1) FINDOUT SIZE FOR ALL DATATYPES AND VARIABLES

CONTROL STATEMENT
Non-iterative

1. biggest of two number

2. biggest of three number

3. Check number is Positive or Negative

4. Check number is even or odd

5. Check alphabet is vowel or consonant

6. Check Character is alphabet or digit or special Character

7. Take input of marks of 5 subjects and calculate the grade of student and if average is

>90 A

>80 B

>70 C

>60 D

>50 E

Iterative

1. Prime Number

2. Prime number upto N number

3. Factorial
4. Factorial upto N number

5. Print Cube upto N number

6. Armstrong number

7. Number of digits in a scanned number

8. Sum of digits of a scanned number

9. Product of digits of a scanned number

10. Repetation of scanned digit in scanned number

11. Input 10 numbers and find largest

12. Reverse a number

13. Palindrome

14. Fibbonacci series upto N number

15. Convert decimal to bianary

Unconditional

1. Using ‘if’ and ‘goto’ make multiplication table

2. Design a menu driven calculator using switch case

3. Check for even and odd by using switch case

4. For 1000 rupees how many notes of 10,50,100,500 requires design by using switch

Patterns

***** (2)
* (1) ****
** ***
***
**
****
***** *
*****
* (3) **** (4)
** ***
***
**
****
***** *
***** *
**** **
***
***
****
** *****
*
* (5) ***** (6)
** ****
*** ***
**** **
***** *

A (7) A (8)
A B B C
A B C D E F
A B C D G H I J
A B C K L M
A B N O
A P
FUNCTION
1. Print given number into binary

2. Check number is power of 2 (use counter in function)

3. Swap of two number using call by reference

4. Swap of two number using call by value

5. Print array element and its address using function

6. Print string element and its address using function

7. Addition of two array element and keep in third array using function

8. Check scanned number is prime or not by using function

9. Design a function which has to print a given string char by char

10. Reverse a number by using function

11. Design your own function STRLEN

12. Design your own function STRCPY

13. Design your own function STRCAT

14. Design your own function STRNCAT

15. Design your own function STRCMP

16. Design your own function STRNCMP

17. Design your own function STRCHR

18. Design your own function STRRCHR

19. Design your own function STRSTR

20. Design your own function STRRSTR


ARRAY
1) How to declare an array
2) How to initialize the array
3) How to scan and print an array element and element address
4) Count no of elements in an array
5) Find Even or odd of given number
6) Find how many prime number in given array
7) Largest and smallest of given an array
8) Find largest and second largest element of an array
9) Reverse the given array
10) Reverse the first N number in element of an array
11) Replace an element in an array
12) Delete an element in a given array
13) Convert decimal number into binary format
14) Sorting: i) bubble sorting, ii) selection sorting
15) How to concordat two arrays
16) Sort the array after concordat two arrays

STRING
1) How to declare, initialise the string.
2) How to scan, print element in the string.
3) How to find length of string.
4) How to copy one string into another string.
5) Find the vowels in an array.
6) Small letter Into capital letter.
7) Convert BANGALORE into BANGALURU.
8) Find how many given character is present in the given string.
9) How to reverse the string.
10) How to concatenate strings.
11) Replace the character in the string.
12) Find the given string is palindrome or not.
13) Convert DEVANSHI into ADEHINSV.
14) Remove consecutive space of given string.
15) Remove the consecutive space but one space should be remain.
16) From WORLD HEALTH ORGANISATION print only WHO.
17) Remove special character in an array.
18) I HAVE MANY BOOK change into (koob ynam evah i).
19) I HAVE MANY BOOK change into (book many have i).
20) Separate integer, character and special character.
POINTERS
1. Initialisation of Pointer : Find out the value for (I, p,*p)

a. int i=10; b. int i=10;


int *p=&i; int *p;
p=i;

c. int i=10; d. int i=10;


int *p=10; int *p;
*p=20; *p=&I;

e. int i=10;
int *p;
p=&i;

2. Find out the size of pointers int, char, float

3. For i=258, find out the value for integer pointer and character pointer.

4. W. A. P. for finding we are working in little or big endian.

5. Find out the binary format of int number using integer pointer.

6. W. A. P. for print binary int of float number using character pointer.

7. INCREMENT AND DECREMENT ON POINTERS

Findout the value and address of i, p

a. *p++
b. ++*p
c. *++p
d. *(p++)
e. (*p)++

2D ARRAY
A. if int b[2][3]= {10,20,30,40,50};

1. printf (“%d\n”, sizeof (b));

2. printf (“%d\n”, sizeof (b[0]));

3. printf (“%d\n”,sizeof(b[0][0]));

4. printf (“b=%u\n”, b);

5. printf (“b[0]=%u\n”, b[0]);

6. printf (“b[0][0]=%u\n”, b[0][0]);


7. printf (“b+1=%u\n”, b+1);

8. printf (“&b+1=%u\n”,&b+1);

9. printf (“b[0]+1=%u\n”, b[0]+1);

10.printf (“&b[0]+1=%u\n”, &b[0]+1);

11. printf (“b[0][0]+1=%u\n”, b[0][0]+1);

12. printf (“&b[0]=%u\n”, &b[0]);

13. printf (“*b=%u\n”, *b);

14. printf (“b++=%u\n”, b++);

15. printf (“*b+1=%u\n”, *b+1);

16. printf (“*(b+1) =%u\n”, *(b+1));

17. printf (“**b+1=%d\n”, **b+1);

18. printf (“*(*b)+1=%d\n”,*(*b)+1);

19. printf (“*(*b+1) =%d\n”,*(*b+1));

20. ADDITION OF MATRIX ELEMENT USING 2D ARRAY.

21. MULTIPLICATION OF MATRIX ELEMENT USING 2D ARRAY.

3D ARRAY
A. c [2][2][3]= {10,20,30,40,50,60,70,80,90,100};

1. Find out all the addresses of the elements in a given array.

2. printf (“c[0]=%u\n”, c[0]+1);

3. printf (“c[0][0]+1=%u\n”, c[0][0]+1);

4. printf (“c[0][0][0]+1=%u\n”, c[0][0][0]+1);

5. ADDITION OF MATRIX ELEMENTS.

ARRAY OF POINTER
A. int i=10, int j=20, k=30;

Int *p[3];

P[0]=&I;

P[1]=&j;
P[2]=&k;

1.Printf(“%d%d%d\n”, *p[0],*p[1],*p[2]);

2.printf(“p=%u\n”,p);

3. printf (“p[0]=%u\n”, p[0]);

4. printf (“p+1=%u\n”, p+1);

5. printf (“p[1]=%u\n”, p[1]);

6. printf (“*p[0]=%u\n”,*p[0]);

7. printf (“*(p+1)=%u\n”,*(p+1));

8. printf (“**p[0]=%u\n”,**p[0]);

B. int a [5]={10,20,30,40,50};

int *p[3] = {a,a+1,a+2};

1.printf(“*p[0] =%d\n”,*p[0]);

2printf(“p[1][0]=%d\n”, p[1][0]);

3.printf(“p[1][1]=%d\n”, p[1][1]);

POINTER TO AN ARRAY
A. int a [5] = {10,20,30,40,50};

Int (*p) [3];

Int *q;

p=a;

q=a;

1. printf (“p=%u p+1=%u\n”, p, p+1);

2.printf (“q=%u q+1=%u\n”, q, q+1);

3.printf (“%d %d %d\n”, (*p)[0], (*p)[1], (*p)[2]);

4.printf (“p=%u *p=%u q=%u *q=%u\n”, p, *p, q, *q);

5.write a program to scan 5 string from a user print in on the screen using 2D array.

6.Design a function for printing 2D array.


COMMAND LINE ARGUMENT
A) For character array

1) How to find length of string.

2) How to copy one string into another string.

3) How to reverse the string.

4) How to concatenation of the string.

5) Replace the character in the string.

6) Find the give string is palindrome or not.

7) Convert BANGALORE into BANGALURU.

8) Find how many given character is present in the given string.

9) Small letter into capital letter.

B) For integer array

10) Find Even or odd of given number.

11) Largest and smallest of given an array

12) Find how many prime number in given array.

13) Replace an element in an array.

14) Design your own atoi function.

DMA
1) WAP FOR ADDITION OF MATRIX ELEMENT USING DMA.
2) WAP FOR MULTIPLICATION OF 2 MATRIX USING DMA.
3) WAP FOR SORTING OF STRING USING DMA.

FILE HANDLING
1. Copy source file content to destination file.

2. Modify the above program in such a way that if destination already exist, interact with
the user for overwrite or not to overwrite and design accordingly

3. W.A.P. to copy source file content in multiple destination file.

4. W.A.P. to copy source file content in multiple destination file using command line
argument.
5. W.A.P. for find out the size of a file (number of character present)//using command
line

6. W.A.P. for find out how many times a given character present in a file//using
command line

7. W.A.P. to search how many times a given word present in a given file.

8. Modify the above programme in such a way, whenever the character present replace
with another.

9. Practice in following command fputs, fgets, fprintf, fscanf.

10. W.A.P. for maintaining of record of 5 students by using fscanf & fprintf and sort
according to the roll no.

11. W.A.P. for fread and fwrite function

12. W.A.P. for replace a character using fseek function

13. Implement your own wc command (no of linr,no, of word, no of newline, size of file
etc)

STRUCTURE
1. Structure declaration, initialisation
2. scan the member of structure
3. W. A. P. to copy the content of one structure into another
4. Array of structure: maintain record of 3 students
5. Sorting according to roll number of above students
6. Nested structure: W. A. P. for maintaining record of employee by their DOB, DOJ, name,
Employee id, age etc
7. Structure pointer: Initialisation of structure using pointer
8. Structure and DMA
A. Dynamic memory allocation with pointer
B. Scanning the dynamic memory with pointer
9. W. A. P. for sorting the record of 3 students by roll no, name, marks; option will be provided by
user
10. Structure bit field: Find the size of structure bit field variable
11. Structure and Function:
A. Passing any structure member to a function
B. Passing any structure to a function
C. Passing any structure to a function using pointer
12. Structure Padding

UNION
1. Address of union variable
2. Number is little or big endian in union

ENUM
1) How to Declare, initialise, scan enum
2) Find out values for enum{red, white, blue, green, black, yellow, orange};
3) Find out values for enum{red=2, white, blue, green, black=1, yellow, orange};
4) Find out values for enum{red, white, blue, green, black=-2, yellow, orange};
5) Find out values for K1=green and K2=orange if
enum K1, K2 {red, white, blue, green, black=-2, yellow, orange};

You might also like