Tuesday, September 26, 2023

Only points of C

 1)Basic of c programming

2)history of c programming

       1960 to C99 

3)Why use  c? 

4)structure of c programming 

         A)Documents section 

         B)Link  section 

         C)definition 

         D)Global declaration section 

         E)Function definition section 

         F) main()/sub programming 

5)Menu of Troub c (10)

     File, Edit, search, run, compile, debug, project, option, 

 Window,  help 

6)Printf(), Scanf(), 

7)String Function :-%d, %c, %s, %n..etc

8)Features of C:-

         Simple, Portable, Mid-Level, Structure, Rich library, Extensible, Recursion, pointers, Faster, Memory Mgt. 


----------------------------------------------------------


Unit 1.Basic of programming & Ubuntu OS

 ---------------------------------------------------------

1)Problem Definition 

2)Problems Solving 

     A)Understanding 

     B)Problems Analysis 

     C)Developing Solutions

     E)Coding and Implementation

3)Problem Analysis :-

   A)Specifying the Objective

   B)Specifying the Output 

   C)Specifying Input Requirements

   D)Specifying process        Requirements

   E)Evaluating the Feasibility

   F)Documents 


4)Algorithm in C:

        "A algorithm is process of Step-by-Step instruction for the solving a problems"

  Eg.--> Step 1:-Start ----etc 


   Features of Algorithm :-

  A)Inputs

  B)Outputs 

  C )Clarity

  D) Finiteness

  E)Validity

  F)Generality


5)Flowchart :-

                  "The Flowchart is the most widely used graphical representation of an algorithm and procedural design workflows"


       A)Terminal,  B)Process 

      C)Flow linn's  D)Decision 

      E) Process     F)Connectors 

     G)I/O   ----/etc



6)Debugging :-

     "The process of identifying and removing errors from computer hardware or software"

"software debugging"


   A)What is Debugging

   B)Why do we need debugging?

   C)Steps involved in debugging

   D)Debugging strategies

   E)Tools required to debug


7)Types of errors :-

      "Errors are the problems or the faults that occur in the program"

      A)Syntax error

      B)Run-time error

      C)Linker error

      D)Logical error

     E)Semantic error

============================

1)Introduction to Linux

Linux is an open-source Unix-like operating system-based family on the Linux kernel, and the OS kernel was first published on 17 September 1991 by Linus Torvalds. Typically, Linux is packaged as the Linux distribution, which contains the supporting libraries and system software and kernel, several of which are offered by the GNU Project. Several Linux distributions use the term "Linux" in the title, but the Free Software Foundation uses the "GNU/Linux" title to focus on the necessity of GNU software, causing a few controversies.


2)‘C’ programming 

language :-

       C is a general-purpose programming language created by Dennis Ritchie at the Bell Laboratories in 1972.

        It is a very popular language, despite being old. The main reason for its popularity is because it is a fundamental language in the field of computer science.

       C is strongly associated with UNIX, as it was developed to write the UNIX operating system


3)Introduction to GCC Compiler:-


In Linux, the GCC stands for GNU Compiler Collection. It is a compiler system for the various programming languages. It is mainly used to compile the C and C++ programs. It takes the name of the source program as a necessary argument; rest arguments are optional such as debugging, warning, object file, and linking libraries.


GCC is a core component of the GNU toolchain. Various open-source projects are compiled using the GCC, such as Linux kernel and GNU tools.


©©©QUESTION ©©©

A)Explain the GCC compiler  in details with components.

==>a)Basic of GCC compiler 

     b)Installation of MinGW process.

    c)How to Set Path 

    d)Simple C program 

    e)Compil and Run process.

     f)Components of GCC :-

             1)GNU Compiler Collection 

             2)GNU Make 

             3)GNU   Binutils 

            4)GNU   Dubggger 

            5) GNU Autotools 

      ***************


    

4)Data Types:-

       Primary Data type:-

         1)int 2)char 3)Float 4)Double 

     Secondary Data types:-

        1)Structure 2)pointers 3)Array 

         4)Function 


5)Variable Declaration:-

      A)Introduction 

      B)Definition 

      C)Rules 

      D)Syntax 

      E)Example 

   .. F)Types of variable:-

             ->Local, Global, Static, Automatic, External 

6)Input/output statement :-

          Input ==>Scanf();

         Output ==>Printf();

7)Bulit in standard  library :-

     A)Standard Library Function

             A.1)Input/output

              A.2)String manipulation functions

              A.3)Mathematical functions

             A.4)Time functions

     B) Users defined Library 

        B.1) Write the function code: 

        B.2) Create a header file:

        B.3) Compile the code:

         B.4) Create the library

        B.5)Link the library: 

8)Simple C program 

 9)Vim (Visual  Editor) 

         Types :-a) Command  mode

                        b)Insert Mode

10)writing the First ‘c’ Program:-

        A)write a simple program in c.

        B)Explain the tools details and compile and run.

11)Compilation and Execution of C Program:-

      A)Preprocessor 

       B)compiler 

      C)Assembler 

       D)Linkers 

12Format Specifies:->

         -->FS used for Input & Output operations on a program. 

   Eg.%d, %i, %x, %S, %C....etc

 Escape Sequence:->

       -->ES used for only Output operations on a program. 

   Eg.\n, \f......etc

---------------------------------------------------------------

1)Branching  Statement :-  

          A)if.....Statment :-

               1)Introduction 

               2)Syntax 

               3)Declaration 

              4)Program 

               5)Output 

               6)Algorithm 

                7)Flowchart 

          B)if......else Statement 

               1)Introduction 

               2)Syntax 

               3)Declaration 

              4)Program 

               5)Output 

               6)Algorithm 

               7)Flowcha

         

             C)Nested.....if  statement :-

              1)Introduction 

               2)Syntax 

               3)Declaration 

              4)Program 

               5)Output 

               6)Algorithm 

                7)Flowchart 

          ✍️📝📕💻📑📖

       


Thursday, September 21, 2023

Unit 1.Basics of Programming and Ubuntu OS

1)Problem definition in computer-

Introduction:

If we define a problem in very simple words, then by performing any operation on the computer, we want to get some kind of processed data i.e. result, we can see all that work as a problem. . For example: Multiplying two numbers is a problem.

Problem definition:

“It is an action to identify the problem, to understand the problem, and to understand any Constraints that may be the limits of the solution.”

This is the first step to develop the program.

In this we understand the problem for which the program has to be developed. That is, the problem is identified and understood in this.

In this step, the problem is formally defined.

In this all the factors like – input/output, memory requirement, processing requirement, error handling etc. are discussed.

Processes (problem solving steps):

  • A computer cannot solve a problem by itself. The computer has to provide a step-by-step solution to the problem. In fact, it is not the job of the computer to solve the problem.
  • It is the programmer who has to write the solution to the problem in terms of simple operations that the computer can understand and operate.

Problem Solving Steps:-

To solve a problem through computer one has to go through certain steps. Such as follows,

  1. Understanding the Problem:
    Here we try to understand to solve the problem completely. Before taking the next step, you must be absolutely sure of the motives of a problem.
  2. Problem Analysis:
    Once we fully understand how to solve the problem, we look for different ways to solve the problem and evaluate each of these methods. The idea here is to find the right solution to the problem in question.

The end result of this step is a detailed review of the sequence of actions taken to solve a problem.

  1. Developing Solutions:
    Here an overview of the sequence of operations resulting from the analysis phase is extended to a step-by-step solution to the problem in question.
  2. Coding and Implementation:
    The final step in problem solving is to translate the detailed sequence of operations into a language that the computer can understand. Here each step is converted into its equivalent instruction or instruction in the computer language which has been selected for implantation.

Problem Analysis

Problem analysis is the process of defining a problem and decomposing overall system into smaller parts to identify possible inputs, processes and outputs associated with the problem. This task is further subdivided into six subtasks namely:

  1. Specifying the Objective :

    First, we need to know what problem is actually being solved. Making a clear statement of the problem depends upon the size and complexity of the problem. Smaller problems not involving multiple subsystems can easily be stated and then we can move onto the next step of “Program Design”. However, a problem interacting with various subsystems and series of programs require complex analysis, in-depth research and careful coordination of people, procedures and programs.

    1. Specifying the Output :

      Before identifying inputs required for the system, we need to identify what comes out of the system. The best way to specify output is to prepare some output forms and required format for displaying result. The best person to judge an output form is the end user of the system i.e. the one who uses the software to his benefit. Various forms can be designed by the programmer which must be examined to see whether they are useful or not.

    2. Specifying Input Requirements :

      After having specified the outputs, the input and data required for the system need to be specified as well. One needs to identify the list of inputs required and the source of data. For example, in a simple program to keep student’s record, the inputs could be the student’s name, address, roll-numbers, etc. The sources could be the students themselves or the person supervising them.

      1. Specifying Processing Requirements :

        When output and inputs are specified, we need to specify process that converts specified inputs into desired output. If the proposed program is to replace or supplement an existing one, a careful evaluation of the present processing procedures needs to be made, noting any improvements that could made. If the proposed system is not designed to replace an existing system, then it is well advised to carefully evaluate another system that addresses a similar problem.

      2. Evaluating the Feasibility :

        After the successful completion of all the above four steps one needs to see whether the things accomplished so far in the process of problem solving are practical and feasible. To replace an existing system one needs to determine how the potential improvements outperforms existing system or other similar system.roblem Analysis DocumentationBefore concluding the program analysis stage, it is best to record whatever has been done so far in the first phase of program development. The record should contain the statement of program objectives, output and input specifications, processing requirements and feasibility.


Algorithm in C language

An algorithm is a sequence of instructions that are carried out in a predetermined sequence in order to solve a problem or complete a work. A function is a block of code that can be called and executed from other parts of the program

A set of instructions for resolving an issue or carrying out a certain activity. In computer science, algorithms are used for a wide range of operations, from fundamental math to intricate data processing.

One of the common algorithms used in C is the sorting algorithm. A sorting algorithm arranges a collection of items in a certain order, such as numerically or alphabetically.

There are many sorting algorithms, each with advantages and disadvantages. The most common sorting algorithms in C are quicksort, merge, and sort.

One of the key features of C is pointer support. This allows efficient manipulation of data structures such as arrays, queues etc. This makes it suitable for implementing algorithms that require complex data manipulation, such as sorting and algorithmic searching.

One of the famous examples of software library implemented in C is the Standard Template Library (STL). This library provides a wide variety of algorithms for tasks such as sorting, searching, and manipulating data structures.

Features of the algorithm

It defines several important features of the algorithm, including:

  • Inputs: Algorithms must receive inputs that can be represented as values or data.
  • Output: The algorithm should produce some output. It can be a consequence of a problem or a solution designed to solve it.
  • Clarity: Algorithms must be precisely defined, using unambiguous instructions that a computer or other system can follow unambiguously.
  • Finiteness: The algorithm requires a limited steps. It means that it should be exited after executing a certain number of commands.
  • Validity: The algorithm must be valid. In other words, it should be able to produce a solution to the problem that the algorithm is designed to solve in a reasonable amount of time.
  • Effectiveness: An algorithm must be effective, meaning that it must be able to produce a solution to the problem it is designed to solve in a reasonable amount of time.
  • Generality: An algorithm must be general, meaning that it can be applied to a wide range of problems rather than being specific to a single problem.

How to write an algorithm

1. First define the problem you want the algorithm to solve.

For example, suppose we want to write an algorithm to find the maximum value from a list of numbers.

2. Break the problem down into smaller, manageable steps.

  • Initialize the 'max' variable to the first value in the list.
  • For each subsequent value in the list, compare with "max".
  • If the value is greater than "max", set "max" to that value.
  • Continue doing this until every value in the list has been compared.
  • Returns the final "max" value.

3. Write your algorithm in pseudocode or a programming language.

Algorithm written in pseudo code:

  1. MAX (list)  
  2.     max = list[0]  
  3.     For i = 1 the length of the list  
  4.         list IF[i] > max  
  5.             max = list[i]  
  6.     End for  
  7.     Maximum return  
  8. Maximum end  

4. Test your algorithm to make sure it is correct and efficient.

You can test the algorithm by entering different lists of numbers and verifying that it returns the maximum correct value. You can also analyze the time complexity of your algorithm to determine how well it scales for larger inputs.

Example:-

Input: [1, 5, 2, 7, 3]

Output: 7.

Explanation: 7 is the maximum value in the list.

5. Optimize the algorithm.

Look for ways to optimize algorithms for making them faster and more efficient. This may involve modifying pseudocode or implementing more efficient data structures or algorithms.

Basic writing of algorithms

Example: - The sum of two integers.

Step 1 - Get started

Step 2 - Declare three integers a, b, c

Step 3 - Define the values of a and b

Step 4 - Add the values of a and b

Step 5 - Save the output of step 4 in c

Step 6 - Print c

Step 7 - Stop



Introduction to Linux

Linux is an open-source Unix-like operating system-based family on the Linux kernel, and the OS kernel was first published on 17 September 1991 by Linus Torvalds. Typically, Linux is packaged as the Linux distribution, which contains the supporting libraries and system software and kernel, several of which are offered by the GNU Project. Several Linux distributions use the term "Linux" in the title, but the Free Software Foundation uses the "GNU/Linux" title to focus on the necessity of GNU software, causing a few controversies.

Famous Linux distributions are Ubuntu, Fedora Linux, and Debian, the latter of which is composed of several different modifications and distributions, including Xubuntu and Lubuntu. Commercial distributions are SUSE Linux Enterprise and Red Hat Enterprise Linux. Desktop distributions of Linux are windowing systems like Wayland or X11 and desktop environments like KDE Plasma and GNOME