About Me

My photo
Vijayapur, Karnataka, India
I am interested in Teaching.

Monday 29 October 2018

Assignment-II C Programming for Problem Solveing

Module 2

1. What are control statements? List.

2. What are conditional statement? List.

3. What is simple-if ? Discuss with explanation, syntax, flowchart and two programming examples.

4. What is if else statement? Discuss with explanation, syntax, flowchart and two programming examples.

5. What is nested if statement? Discuss with explanation, syntax, flowchart and two programming examples.

6. What is else if ladder statement? Discuss with explanation, syntax, flowchart and two programming examples.

7. Discuss switch statement syntax, flowchart and two programming examples.

8. What are loop statements? List.

9. Write differences between while and do while loop.

10. Discuss for statement with syntax, flowchart and programming examples.

11. Write c programs for the following.

To check, whether the entered year is leap year or not leap year.

To find largest of three numbers using nested if statement.

Fo find largest three numbers using else if ladder.

To simulate simple calculator to perform arithmetical calculations like addition, subtraction, multiplication and division by using switch statement.

To provide the following menu option to work accordingly.
1. Area of circle
2. Area of rectangle
3. Area of triangle
Enter your choice:

Module 3

1. What is one dimensional array? Discuss its declaration and initialization with syntax and examples.

2. What is two dimensional array? Discuss its declaration and initialization with syntax and examples.

3. Write C programs for following

To find largest and lowest of N numbers using 1D array.

To implement linear search technique.

To implement binary search technique.

To find addition of two matrices by checking for their compatibility.

To find multiplication of two matrices by checking for their compatibility.












Friday 26 October 2018

Algorithms

What is an algorithm?

Algorithm can be defined as step by step procedure to solve a given problem by using a computer system to get desired result. It includes finite number of steps in hierarchical order from start to stop.

Characteristics of algorithm:
1. It should be unambiguous (no doubts).
2. It should not have any uncertainty steps.
3. It should generate correct result.

Examples.
Algorithm to check for palindrome.

Step1: Start

Step2: Read a number i.e. num

Step3: dup=num

Step4: while  (num!=0)
            rem=num%10
            rev=(rev*10)+rem
            num=num/10

Step5: Print reversed number i.e. rev

Step6:  if (rev==dup)
            Display "Plaidrome"
            else
            Display "Not Palidrome"
         
Step7 : Stop

Algorithm to generate electricity bill

Step1: Start

Step2:  Read user name and number of units consumed i.e. name, units

Step3: if (units<=200) goto next step; otherwise goto step 5

Step4: amt=units*0.80 and goto step

Step5: if (units<=300) then goto next step; otherwise goto step 7

Step6: amt=160+((units-200)*0.90) and goto step 8

Step7: amt=250+((units-300)+1) and goto next step

Step8: total_amt=amt+100

Step9: if (total_amt>400) goto next step; otherwise goto step 11

Step10: sur_charge=total_amt*0.15, total_amt=total_amt+sur_charge

Step11: Print name and total_amt

Step12: Stop







Friday 5 October 2018

Assignment-II Unix and Shell Programming

1. Explain the different modes of vi editor with neat block diagram. Jan 2017
    Introduction to vi editor: 1m
    Block diagram: 2m
    Explanation of three modes with commands used: 2 x 3 =6m
    Total=9 m

2. Discuss the navigation commands used in vi editor. Jan-2017

3. Explain Shell's interpretive life cycle. Jan.2017

4. Explain what wild-card patterns match:
1) [A-Z]????*   2) *[0-9]*    3) *[!0-9]   4) *.[!S][!h]

5. Write the output of following Unix commands.
1) ls *.c   2) mv * ../ise   3) cp foo foo*   4) cp  ??????  progs   5) lp note[0-1] [0-9]
5) rm *.[!l][!0][!g]  6) cp  /home/cse/{A,B,C}  .

6. Discuss the three standard files supported by Unix.  (Standard I/O or Redirections)

7. Discuss Escaping and Quoting with examples.

8. Explain the following with examples.
pipe, tee and command substitution

9. Discuss the commands used for configuring vi editor. i.e. set, ab, map

10. What is .exrc ? Give example.

11. What is grep command? Dicuss with syntax, options, and examples.

12. What is egrep command? Give examples.

13. Discuss sed with line and context addressing techniques.

14. Write short note on BRE and ERE with examples.

15. What is shell programming?Give any three examples.

16. What is conditional execution in UNIX?Give examples.

17. Write all the forms of if statement supported by shell script with syntax and examples.

18. Write short note on "Command Line Arguments" with examples.

19. Explain the test and [ ] with examples.

20. Write shell scripts for the following.

A shell script to read pattern to be search and filename from the users from the terminal to apply grep command.

A shell script to read pattern and filename to apply grep command using command line arguments.

A shell script to display the following with appropriate messages.
Display system date.
Display user name of current user.
Display a list of users who are currently logged into the computer.
Display details of process in use.
Print current working directory.
Display shell in use.







Wednesday 3 October 2018

Assignment-I (Part-II) C Programming for Problem Solving

Discuss in brief about "Structure of C Program" with programming example.

What are C-tokens? List and discuss in brief.

What are data types? List and discuss in brief.

What is variable?Discuss it's declaration and initialization with syntax and examples.

What are I/O functions? Discuss formatted I/O functions with syntax and examples.

List and Discuss any 5 types of operators supported by C language.

Write C programs for following.

  • To find largest of two numbers using if else statement.
  • To find largest of three numbers using conditional operator.
  • To check, whether the number is Even or Odd number.
  • To check, whether the year is leap year or not leap year.
  • To find sum of first and last digit of entered 3 digits number.
  • To swap (interchange) the contents of two variables using temporary variable.
  • To swap (interchange) the contents of two variables without using temporary variable.





GCD of two numbers and its application...

The greatest common divisor (gcd) of two numbers is the largest positive integer that divides both numbers without leaving a remainder. The ...