Posts

Differentiate entry control and exit control loop.

  Difference between Entry control loop and Exit control loop: Basic Of Comparision Entry Controlled Loop Exit Controlled Loop Description Entry controlled loop is a loop in which the test condition is checked first, and then the loop body will be executed. Exit controlled loop is a loop in which the loop body is executed first and then the given condition is checked afterward. False Test Condition If the test condition is false, the loop body will not be executed. If the test condition is false, the loop body will be executed at least once. Example Examples of entry-controlled loops include, for loop and while loop. An example of an exit controlled loop is do…while Loop. Use Entry controlled loops are used when checking of test condition is mandatory before executing the loop body. Entry controlled loop is used when checking of test condition is mandatory after executing. Drafted on 🌏 by, Jal ☮ peace

Algorithm and Flowchart

Image
  Algorithm (Definition):     An algorithm  is a  finite sequence  of  well-defined steps  for  solving a problem . or     An algorithm is a  complete ,  detailed , and  precise step-by-step method  for  solving a problem  independently. Flowc hart (Definition):     A flowchart  is a  pictorial  or  graphical representation  of a  program  or an  algorithm . or     A flowchart is a  pictorial representation  of an  algorithm  depicting the  flow of various steps. Algorithm to find whether the number is even or odd: Step 1: Read no. Step 2: If no mod 2 = 0, go to step 4. Step 3: Print no is odd, go to step 5. Step 4: Print no is even. Step 5: Stop Flowchart to find whether the number is even or odd: Drafted on 🌏 by, Jal ☮ peace

What is Software?

Software (Definition): A set of instructions in a logical order to perform a meaningful task is called a program and a set of programs is called software. It tells the hardware how to perform a task. Types of software 1. System software  It is designed to operate the computer hardware efficiently. Provides and maintains a platform for running application software. Examples: Windows, Linux, Unix, etc. 2. Application software It is designed to help the user to perform a general task such as word processing, web browser, etc. Examples: Microsoft Word, Excel, PowerPoint, etc. Categories of System software: i. Operating system It controls hardware as well as interacts with users, and provides different services to users.  It is a bridge between computer hardware and the user.  Examples: Windows XP, Linux, UNIX, etc… ii. System support software It makes the working of hardware more efficient.  For example drivers of the I/O devices or routine for socket programming, etc… i...

C tokens

C Token (Definition): The smallest individual unit of a program is known as a token. C has the following tokens: Note: If a student had written any 3 of the following then the answer is correct. Keywords: C reserves a set of 32 words for its own use. These words are called keywords (or reserved words), and each of these keywords has a special meaning within the C language. Identifiers: Identifiers are names that are given to various user-defined program elements, such as variables, functions, and arrays. Constants: Constants refer to fixed values that do not change during the execution of the program. Strings: A string is a sequence of characters terminated with a null character \0. Special Symbols: Symbols such as #, &, =, * are used in C for some specific function are called special symbols. Operators: An operator is a symbol that tells the compiler to perform a certain mathematical or logical operation. Drafted on 🌏 by, Jal ☮ peace

Pattern #4

Image
Program: #include <stdio.h> void main() {     int i, j, k;          for(i=4;i>=0;i--)     {         for(k=1;k<=i;k++)         {             printf(" ");         }         for(j=k;j<=5;j++)         {             printf("*");         }         printf("\n");     } } Output:     *    **   ***  **** ***** Drafted on 🌏 by, Jal ☮ peace

Pattern #3

Image
Program: #include <stdio.h> void main() {     int i, j;          for(i=1;i<=5;i++)     {         for(j=1;j<=i;j++)         {             printf("%d",j);         }         printf("\n");     } } Output: 1 12 123 1234 12345 Drafted on 🌏 by, Jal ☮ peace

Pattern #2

Image
Program: #include <stdio.h> void main() {     int rows, i, j, number = 1;     printf("Enter the number of rows: ");     scanf("%d", &rows);     for (i = 1; i <= rows; i++)     {         for (j = 1; j <= i; ++j)         {             printf("%d ", number);             ++number;         }         printf("\n");     } } Output: 1 23 456 78910 Drafted on 🌏 by, Jal ☮ peace