UNIT 1 UNIT 2 UNIT 3 UNIT 4 UNIT 5 UNIT 6 UNIT 7 UNIT 8
Home Online Quiz Lab Programs Previous Questions Resources Glossary Syllabus Faculty Team

Latest News

Lesson PPTs have been uploaded to Resources Section.


Teaching material,Tutorials and Practice problems of all UNIT's are added.


ebooks have been uploaded to Resources Section.



UNIT 1


TOPICS TO BE COVERED IN THIS UNIT:

  1. Algorithm / pseudo code
  2. Flowchart
  3. Program development steps
  4. Structure of C program
  5. A Simple C program
  6. Identifiers
  7. Basic data types and sizes
  8. Constants and Variables
  9. Operators:- Conditional, Arithmetic, Logical, Increment and Decrement, Bit-wise, Relational, Assignment, Special Operators
  10. Expressions and Type conversions
  11. Conditional Expressions
  12. Precedence and Order of Evaluation.
  13. Input-output statements
  14. Statements and Blocks
  15. if and switch statements
  16. Loops- while, do-while and for statements
  17. break, continue, goto and labels


TEACHING MATERIAL

Unit 1 Teaching Aids - Click Here


TUTORIAL MATERIAL

Tutorial 1


  1. Give the pictorial representation of different symbols used in flowchart and when it is used?
  2. Write an algorithm/ pseudo code for multiplication of three given numbers?
  3. Write an algorithm for given problems.
    1. Calculate the simple interest formula I =PNR / 100 (where P- price, N- number of years, R- Rate of Interest)
    2. Find out the Area and Perimeter of a circle.
  4. Name different sections used in structure of a 'C' program by using arrows.K
             #include ---------------->
             Int  s = 1;------------------------------>
            main()-------------------------------->
                {
                    Int a, b;------------------------------>
                   Printf("enter a&b values");
                   Scanf("%d%d", &a, &b,&c);                    }---> 
                   S=add(a, b,c);
                   Printf("product is %d", S);
                }
            add(int x, int y,int z)
               {
                    s=a+b+c; }-------->
                   return(s);
               }
    

Tutorial 2



  1. Indentify which one is a Reserved word, Identifier, Constants, Variables.
    Height	perimeter	'8'	0
    Avg	 "Hello"	10	5.52
    Sum	"India"	x	#define N 10
    Area	'a'	y	# define a 15
    Auto	sizeof		goto	default
    
  2. main()
    {
      int i = 3
      printf("%d", i);
      printf("%d", i++);
      printf("%d", i++);
      printf("%d", ++i);
      printf("%d",++i);
      printf("%d", i++);
    }
    
    What is the output?

  3. Do the following:.
    1. Read int x & int y values and o/p c = 2a+3b. Implement that by using scanf & Printf statement.
    2. (1.) Condition 3 > 2 . (2.) print True or False. Implement that using conditional operator.
  4. Name different types of operators?

Tutorial 3



  1. Write a program by using following conditions. Read input value X.
    If x = 0 	print output value y = 0;
    If x < 1	print output value y = -1;
    If x > 1 	print output value y = 1;
    
  2. Read the value of age, if age>17 print eligible for voting otherwise print not eligible.
  3. Write a program to find the roots of quadratic equation using if - else condition?
  4. Write a program to find the largest of 3 numbers using nested if - else statement?
  5.  main()
      {
        Int   i,j;
        for(i=1;i<=10;i++)
        for(j=1;j<=3;j++)
           {
             If (i>3)
                 break;
            Printf("%d%d",i,j);
           }
       Printf("comes out of the loop");
      }
     
    What is the output?
  6.  main( )
      {
       Int  x;
       Printf("enter a number");
       Scanf("%d",&x);
       If (x%2==0)
            Goto even;
       Else
            Goto odd;
       Even:printf("no is even");
       Odd :printf("no is odd");
      }
      
    Find the output when
    a) x=12;
    b )x=27;

Tutorial 4



  1. Read two values a & b. Now write a program to perform Addition, Subtraction, Multiplication and Division of two numbers using switch.
  2. Write a program to display 1 to 20 numbers.
    1. Using while loop
    2. Using do - while.
    3. Using for - loop.
  3. 3. Write a program to implement nth table to the given number
    1. Using while loop
    2. Using do - while.
    3. Using for -loop.


PRACTICE PROBLEMS

Beginner Problems


  1. Name the different sections in the structure of a C program by using arrows.
    1.       /*Addition of 2 numbers*/
      #include------>headerfile section(for example)
      main()-------------
      {
      int a, b, c----------------
      printf("enter a&b values");
      scanf("%d%d", &a, &b);        }-----
      c = a+b;
      printf("output is %d", C);
      }
      
    2. #include ----------------
      int  s = 1;------------------------------
      main()--------------------------------
      {
      int a, b;-------------------------------
      printf("nter a&b values");
      scanf("%d%d", &a, &b);                    }---
      s=mul(a, b);
      printf("product is %d", s);
      }
      mul(int x, int y)
      { s=a*b; }---
      return(s); }
  2. Write different types of control string used for their data type?
      1. Char-%c (for example)_______
      2. Short or int _______________
      3. long __________________
      1. Double__________________
      2. Long double_______________
      3. Char_____________________
  3. Here x = 11; y = 12.5. Write a program to compute Addition, Subtraction and Multiplication of two numbers.
  4. Write a program to find out the area of a square for given side "s" area = s*s, perimeter = 4*s.
  5. Name some key words or reserved words used by compiler.
  6. Indentify which one is a Reserved word, Identifier, Constants, Variables.
    Height   	perimeter		"8"		0
    Avg	       	"Hello"	        	  10   	5.52
    Sum         	"India"		  x		#define N 10
    Area		"a"			  y		# define a 15
    Matrix[3]
    Ex: height ->variable,identifier
    
  7. Name different operators used in the expression?
    1. Int a, b
    2. 5>3: y = 5: y : 3
    3. Printf("%d", x++)
    4. printf("%d", - -x);
  8. Name the different operators used in the expression.
    1. z* y ++___________
    2. printf("%", &x)______
    3. x = 10 size of (x)_____________
    4. a < = b_____________
    5. 5 > 3 && 5 < 10_____________
    6. 8 > 5 || 8 < 2 ___________
    7. X >> = 2__________
    8. X<< = 3___________
    9. a = 8 ; b = 4; c = a*b____________
    1. a = 8, b = 4 c = a&b
      printf("%d", c);
      output = ________
    2. a = 8; b = 8 c = a&b
      printf("%d", c);
      output = ________
  9. Write the difference between "=" and"=="
  10. X = 10 * 10 = _______________
  11. 8 % 10 = __________________
  12. If i=3then value of i++ is ____________
  13. main()
    {
    int a, b, c;
    a = 3; b = 5;
    c = (ba)
    printf("%d",c);
    }
    Output = ___
  14. x = 3.3; y = 4; write a program to print the output x+y+2*3.
  15. Write syntax for if statement.
  16. Write syntax for if? else.
  17. Write a program by using if ? else statement.
    1. If user enter character is "S" and age is less <20 then print girl is excellent, otherwise print ok.
  18. Write the syntax for nested if ? else statement.
  19. The break statement allows us to terminate the _____________
  20. If we use break statement in the inner loop, the control of the program is terminated only from the ______________________.
  21. In __________________ statement if it occurs in the loop, it skips the statement after this statement and continues the loop.
  22. In which general decision control statement we use more times a break statement?
  23. Goto statement requires condition T/F [ ]
  24. Goto statement passes control ______________ in the program.
  25. In which loop at least once it will executed _____________________.
  26. If we write a program in one loop we can write that program in other loops also T/F [ ]
  27. The default statement in switch is executed ___________________.

Intermediate Problems


  1. How you declare these variables.
    1. X = 20
    2. Y = 12.3
    3. C = ""
    4. D = "uma"
    5. Phone no: 232848
    6. 6. cell no: 9866132848.
    7. Ex: int x;
  2. 16 >> 2 = __________________
  3. If k = 8 then value of k++ - k++ is _______________
  4. pi=3.14, l & b are length & breadth of rectangle. Write a program to find out the area (l*b) and perimeter 2*( l+b) of a rectangle?
  5. Write a program by using if statement following these conditions
    1. If user enters character "N" print girl is Nice
    2. If user enters character "S" print girl is Super.
    3. If user enters any other character print not nice.
  6. Write a program to find out the smallest of 3 numbers using nested " if " else?
  7. for(i=1 ;i<=3;i++)
    for(j=1;j<=2;j++)
    for i=1 iteration j executes for values j= ___&j=_____;
    for i=___ iteration j executes for values j=1 & j=2;
    for i=3 iteration j executes for values j= ___&j=_____;

Advanced Problems


  1. Write a program to swap two numbers without using 3rd variable"
  2. Write the differences between a character and a string
  3. Generally where do we use "continue" statement"
  4. Write a program to print, multiples of "3" using.
    1. for loop
    2. while " loop
    3. do - while
  5. for(i=1 ;i<=3;i++)
    for(j=1;j<=2;j++)
    How many times totally this loop executes"

This Page Is Designed By D.L.N.Raju

Copyright (c) Aditya Engineering Colleges, Surampalem. All rights reserved.
Development Team