computer-nec-license
  • NEC-Computer
  • 1. Concept of Basic Electrical and Electronics Engineering
    • 1.1 Basic Concepts
    • 1.2 Network Theorems
    • 1.3 Alternating Current Fundamentals
    • 1.4 Semiconductor Device
    • 1.5 Signal Generator
    • 1.6 Amplifiers
    • MCQs
      • MCQs On Basic Electrical
        • set-1
        • set-2
      • MCQs On Basic Electronics
        • set-1
        • set-2
  • 2. Digital Logic and Microprocessor
    • 2.1 Digital Logic
    • 2.2 Combinational & Arithmetic Circuit
    • 2.3 Sequential Logic Circuits
    • 2.4 Microprocessor
    • 2.5 Microprocessor System
    • 2.6 Interrupt Operations
    • MCQs
      • MCQs On Digital Logic
        • set-1
        • set-2
        • set-3
        • set-4
        • set-5
        • set-6
        • set-7
        • set-8
        • set-9
        • set-10
        • set-11
        • set-12
      • MCQs On Microprocessor
        • set-1
        • set-2
        • set-3
        • set-4
        • set-5
        • set-6
        • set-7
        • set-8
        • set-9
  • 3. Programming Language and Its Applications
    • 3.1 Introduction to C Programming
    • 3.2 Pointers, Structures, and Data Files
    • 3.3 C++ Language Constructs with Objects and Classes
    • 3.4 Features of Object-Oriented Programming
    • 3.5 Pure Virtual Functions and File Handling
    • 3.6 Generic Programming and Exception Handling
    • MCQs
      • set-1
      • set-2
      • set-3
      • set-4
      • set-5
  • 4. Computer Organization and Embedded System
    • 4.1 Control and CPU
    • 4.2 Computer Arithmetic and Memory System
    • 4.3 I/O Organization and Multiprocessor
    • 4.4 Embedded System Design
    • 4.5 Real-Time Operating and Control Systems
    • 4.6 Hardware Description Language (VHDL) and IC Technology
    • MCQs
      • set-1
      • set-2
      • set-3
      • set-4
      • set-5
      • set-6
      • set-7
      • set-8
      • set-9
      • set-10
      • set-11
  • 5. Concept of Computer Network and Network Security System
    • 5.1 Introduction to Computer Networks
    • 5.2 Data Link Layer
    • 5.3 Network Layer
    • 5.4 Transport Layer
    • 5.5 Application Layer
    • 5.6 Network Security
    • MCQs
      • Basic Networking
        • set-1
        • set-2
      • Advanced Networking
        • set-1
        • set-2
        • set-3
        • set-4
        • set-5
        • set-6
  • 6. Theory of Computation and Computer Graphics
    • 6.1 Introduction to Finite Automata
    • 6.2 Introduction to Context-Free Languages (CFL)
    • 6.3 Turing Machines (TM)
    • 6.4 Introduction to Computer Graphics
    • 6.5 Two-Dimensional Transformation
    • 6.6 Three-Dimensional Transformation
    • MCQs
      • MCQs on Theory of Computation
        • set-1
        • set-2
        • set-3
      • MCQs On Computer Graphics
        • set-1
        • set-2
        • set-3
        • set-4
        • set-5
        • set-6
  • 7. Data Structures and Algorithm, Database System and Operating System
    • 7.1 Introduction to Data Structures, Lists, Linked Lists, and Trees
    • 7.2 Sorting, Searching, Hashing and Graphs
    • 7.3 Introduction to Data Models, Normalization, and SQL
    • 7.4 Transaction Processing, Concurrency Control, and Crash Recovery
    • 7.5 Introduction to Operating System and Process Management
    • 7.6 Memory Management, File Systems, and System Administration
    • MCQs
      • MCQs ON DSA
        • set-1
        • set-2
        • set-3
        • set-4
        • set-5
        • set-6
      • MCQs On DBMS
        • set-1
        • set-2
      • MCQs On Operating System
        • set-1
        • set-2
        • set-3
        • set-4
        • set-5
        • set-6
        • set-7
        • set-8
        • set-9
        • set-10
        • set-11
        • set-12
  • 8. Software Engineering and Object-Oriented Analysis & Design
    • 8.1 Software Process and Requirements
    • 8.2 Software Design
    • 8.3 Software Testing, Cost Estimation, Quality Management, and Configuration Management
    • 8.4 Object-Oriented Fundamentals and Analysis
    • 8.5 Object-Oriented Design
    • 8.6 Object-Oriented Design Implementation
    • MCQs
      • set-1
      • set-2
      • set-3
      • set-4
      • set-5
      • set-6
      • set-7
      • set-8
      • set-9
  • 9. Artificial Intelligence and Neural Networks
    • 9.1 Introduction to AI and Intelligent Agents
    • 9.2 Problem Solving and Searching Techniques
    • 9.3 Knowledge Representation
    • 9.4 Expert System and Natural Language Processing
    • 9.5 Machine Learning
    • 9.6 Neural Networks
    • MCQs
      • set-1
      • set-2
      • set-3
      • set-4
      • set-5
      • set-6
      • set-7
      • set-8
      • set-9
  • 10. Project Planning, Design and Implementation
    • 10.1 Engineering Drawings and Its Concepts
    • 10.2 Engineering Economics
    • 10.3 Project Planning and Scheduling
    • 10.4 Project Management
    • 10.5 Engineering Professional Practice
    • 10.6 Engineering Regulatory Body
    • MCQs
      • MCQs On Engineering Drawing
        • set-1
        • set-2
      • MCQs On Engineering Economics
      • MCQs On Project Planning & Scheduling
      • MCQs On Project Mangement
      • MCQs On Engineering Professional Practice
      • MCQs On Engineering Regulatory Body
  • Questions Sets
    • Set 1 (Chaitra, 2080)
      • Short Questions (60*1=60 Marks)
      • Long Questions (20*2=40 Marks)
    • Set 2 (Aasadh, 2081)
      • Short Questions (60*1=60 Marks)
      • Long Questions (20*2=40 Marks)
    • Set 3 (Asojh, 2080)
      • Short Questions (60*1=60 Marks)
      • Long Questions (20*2=40 Marks)
    • Model Set - Computer Engineering By NEC
      • Short Questions (60*1=60 Marks)
      • Long Questions (20*2=40 Marks)
    • Model Set - Software Engineering By NEC
      • Short Questions (60*1=60 Marks)
      • Long Questions (20*2=40 Marks)
  • Tips & Tricks
Powered by GitBook
On this page
  • 1. C Tokens
  • 2. Operators
  • 3. Input and Output (Formatted and Unformatted)
  • 4. Control Statements
  • 5. Functions
  • 6. Arrays
  • 7. String Manipulations
  • Conclusion
  1. 3. Programming Language and Its Applications

3.1 Introduction to C Programming

C is a general-purpose, procedural, and middle-level programming language used for developing computer software, system programming, applications, games, and more. Known for its simplicity and efficiency, C is an excellent choice for beginners as it provides a strong foundation in programming concepts. C was developed by Dennis M. Ritchie at Bell Laboratories in 1972.

1. C Tokens

  • C Tokens are the building blocks of a C program. They are categorized into:

    • Keywords: Reserved words (e.g., int, if, while, return).

    • Identifiers: Names for variables, functions, and arrays (e.g., main, num).

    • Constants: Fixed values used in a program (e.g., 10, 'A').

    • Strings: Sequence of characters enclosed in double quotes (e.g., "Hello").

    • Operators: Symbols that perform operations (e.g., +, -, *, /).

    • Special Characters: Punctuation marks with specific functions (e.g., {, }, ;).


2. Operators

  • Arithmetic Operators: +, -, *, /, %.

  • Relational Operators: ==, !=, <, >, <=, >=.

  • Logical Operators: &&, ||, !.

  • Bitwise Operators: &, |, ^, ~, <<, >>.

  • Assignment Operators: =, +=, -=, *=, /=, %=.

  • Increment/Decrement: ++, --.


3. Input and Output (Formatted and Unformatted)

  • Formatted I/O:

    • Input: scanf() (e.g., scanf("%d", &num);)

    • Output: printf() (e.g., printf("Value: %d", num);)

  • Unformatted I/O:

    • Input: getchar(), gets() (e.g., char c = getchar();)

    • Output: putchar(), puts() (e.g., puts("Hello");)


4. Control Statements

  • Decision-Making:

    • if, if-else, else if, switch.

    • Example:

      if (a > b) {
          printf("A is greater");
      } else {
          printf("B is greater");
      }
  • Looping:

    • For Loop: Executes a block of code a fixed number of times.

      for (int i = 0; i < 10; i++) {
          printf("%d\n", i);
      }
    • While Loop: Executes as long as a condition is true.

      codeint i = 0;
      while (i < 10) {
          printf("%d\n", i);
          i++;
      }
    • Do-While Loop: Executes at least once, then continues based on a condition.

      int i = 0;
      do {
          printf("%d\n", i);
          i++;
      } while (i < 10);

5. Functions

  • User-Defined Functions:

    • Functions created by the user for modularity and reusability.

    • Syntax:

      return_type function_name(parameters) {
          // Function body
          return value;
      }
    • Example:

      int add(int a, int b) {
          return a + b;
      }
  • Recursive Functions:

    • Functions that call themselves, typically used for tasks like calculating factorials or solving Fibonacci series.

    • Example:

      int factorial(int n) {
          if (n == 0) return 1;
          return n * factorial(n - 1);
      }

6. Arrays

  • 1D Arrays:

    • Syntax:

      int arr[10];
    • Example:

      int arr[5] = {1, 2, 3, 4, 5};
      for (int i = 0; i < 5; i++) {
          printf("%d ", arr[i]);
      }
  • 2D Arrays:

    • Syntax:

      int matrix[3][3];
    • Example:

      int matrix[2][2] = {{1, 2}, {3, 4}};
      for (int i = 0; i < 2; i++) {
          for (int j = 0; j < 2; j++) {
              printf("%d ", matrix[i][j]);
          }
      }
  • Multi-Dimensional Arrays:

    • Arrays with more than two dimensions (rarely used).


7. String Manipulations

  • String Functions (from <string.h>):

    • strlen(): Finds the length of a string.

    • strcpy(): Copies one string to another.

    • strcat(): Concatenates two strings.

    • strcmp(): Compares two strings.

    • Example:

      char str1[10] = "Hello";
      char str2[10];
      strcpy(str2, str1);
      printf("%s", str2); // Output: Hello

Conclusion

C is a versatile and efficient language that lays the groundwork for programming concepts. Its features, such as tokens, operators, control statements, arrays, functions, and string manipulations, empower developers to write structured and robust code. C’s simplicity and modularity make it an ideal choice for beginners and a powerful tool for developing a wide range of applications, from system software to games.

Previous3. Programming Language and Its ApplicationsNext3.2 Pointers, Structures, and Data Files

Last updated 5 months ago