Posts

Showing posts from April, 2023

SOME C PROGRAMS (As discussed in Youtube live on 16/04/2023)

 PROGRAMS 1. Program to read and display the string. #include<stdio.h> #include<conio.h> void main() {      char n[20];      clrscr();     printf(""Enter your nane :");     scanf("%s",n);     printf("\nEntered value of string is %s",n);     getch(); } ________________________________________________________________________________ 2. Program to copy one string to another string #include<stdio.h> #include<conio.h> #include<string.h> void main() {      char m[20],n[20];      clrscr();     printf(""Enter First String:");     scanf("%s",m);    strcpy(n,m);     printf("\nNow after copy second string is %s",n);     getch(); } __________________________________________________________________________________ 3. Program to compare two strings (With Case sensitivity) #include<stdio.h> #include<conio.h>...

DECISION MAKING STATEMENTS IN C

Image
  Decision Making Statements : if, if else,nested if, switch statement if STATEMENT if is most basic statement of Decision making statement. It tells to program to execute a certain part of code only if particular condition or test is true. Syntax if(<condition>)     [ Statement or block of statements]; Example #include<stdio.h> #include<conio.h> void main() { int a=9; if(a<10) { printf(“a is less than 10”); } getch(); } Output a is less than 10 Constructing the body of "if" statement is always optional, Create the body when we are having multiple statements. For a single statement, it is not required to specify the body. If the body is not specified, then automatically condition part will be terminated with next semicolon ( ; ). if -else STATEMENT It is a keyword, by using this keyword we can create a alternative block for if part. Using else is always optional i.e, it is recommended to use when we are having alternate block of condition. In any prog...

HOW BHAGWADGITA IS USEFUL IN MEDICAL FIELD?

  HOW BHAGWADGITA IS USEFUL IN MEDICAL FIELD                     The Bhagavad Gita is a spiritual and philosophical text that has been revered for centuries in Hinduism and beyond. While it is not a medical text per se, it contains valuable teachings that can be applied in the medical field and other areas of life.                     One aspect of the Bhagavad Gita that may be particularly relevant to the medical field is its teachings on the nature of the self and the relationship between the body, mind, and spirit. In the Bhagavad Gita, it is emphasized that the true self or consciousness is distinct from the physical body and the mind, and that the body is a temporary vessel for the self to inhabit. This perspective can help medical professionals to approach their patients with a deeper understanding of the holistic nature of health and wellness.    ...

C Programming Fundamentals

Image
  C programming : Structure of C program, Tokens, Formatted and Unformatted I/O Structure of C program Documentation Section It includes the statement specified at the beginning of a program,such as a program's name, date, description, and title. // Program for Addition of Two Numbers Preprocessor Directive The preprocessor section contains all the header files used in a program. It informs the system to link the header files to the system libraries. It is given by #include"stdio.h" Definition Section The define section comprises of different constants declared using the define keyword. It is given by: #define pi 3.14 Global Declaration The global section comprises of all the global declarations in the program. It is given by: int a=5; main Function main() is the first function to be executed by the computer. It is necessary for a code to include the main(). It is like any other functio...
Image
 FLOWCHARTS                In simple ways flowchart is nothing but Diagramatic representation of Algorithm. Flowchart shows steps in sequential order and is widely used in presenting the flow of algorithms, workflow or processes.                            Typically, a flowchart shows the steps as boxes of various kinds, and their order by connecting them with arrows. Flowchart is tool for representing algorithms and programming logic but had extended to use in all other kinds of processes. Some Flowchart Symbols Example Below is th  flowchart is for the following algorithm for calculating profit or loss in business 1, Read Buy value of ITEM 2. Read Sell value of ITEM 3. If sell value is greater than buy value then 7 4. Calculate Loss= Buy-Sell 5. Print Loss 6. Goto 9 7. Calculate Profit=Sell-Buy 8. Print Profit 9. End Related Video on Youtube

ALGORITHM

 ALGORITHM : Characteristics, Properties, Types , Advantages and Disadvantages              The word Algorithm means ” A set of rules to be followed in calculations or other problem-solving operations ” Or "A procedure for solving a problem in a finite number of steps that frequently by recursive operations" Therefore Algorithm refers to a sequence of finite steps to solve a particular problem.             It can be understood by taking the example of cooking a new recipe. To cook a new recipe, one reads the instructions and steps and executes them one by one, in the given sequence. The result thus obtained is the new dish cooked perfectly. Every time you use your phone, computer, laptop, or calculator you are using Algorithms. Similarly, algorithms help to do a task in programming to get the expected output. The Algorithm designed are language-independent, i.e. they are just plain instructions that can be imple...

APPLICATION AREAS OF C PROGRAMMING LANGUAGE

Image
 APPLICATION AREAS OF C PROGRAMMING LANGUAGE Operating Systems:-  A high-level programming language built in the C programming language was used to construct the first operating system, which was UNIX. Later on, the C programming language was used to write Microsoft Windows and several Android apps. GUI (Graphical User Interface):- Since the beginning of time, Adobe Photoshop has been one of the most widely used picture editors. It was created entirely with the aid of the C programming language. Furthermore, C was used to develop Adobe Illustrator and Adobe Premiere.  Embedded Systems:- Because it is directly related to the machine hardware, C programming is often regarded as the best choice for scripting programs and drivers for embedded systems, among other things.  Google:- You can also use the C/C++ programming language to create the Google Chrome web browser and the Google File System. Furthermore, the Google Open Source community includes many projects that a...

DIFFERENCE BETWEEN COMPILER AND INTERPRETER

Image
DIFFERENCE BETWEEN COMPILER AND INTERPRETER  The main difference between a compiler and an interpreter is that a compiler converts the entire source code to machine code or bytecode before execution, while an interpreter executes the source code line by line. Execution Speed: A compiled program is usually faster than an interpreted program because the entire source code is translated into machine code or bytecode before execution, which eliminates the need for repeated translation of the code. Memory Usage: An interpreter generally uses less memory than a compiled program because the interpreter only needs to keep track of the current line of code and the current state of the program, whereas a compiled program requires a separate executable file that is loaded into memory. Portability: Interpreted languages are usually more portable than compiled languages because the interpreter can be run on any platform that supports it, whereas a compiled program must be compiled for each spe...

TRANSLATORS

 TRANSLATORS           Computers are electronic devices that can only understand machine-level binary code (0/1 or on/off), and it is extremely difficult to understand and write a program in machine language, so developers use human-readable high level and assembly instructions. To bridge that gap, a translator is used, which converts high-level instructions to machine-level instructions (0 and 1). The translator is a programming language processor that converts a high-level or assembly language program to machine-understandable low-level machine language without sacrificing the code's functionality. The computer only understands machine code. It is unable to understand any low, assembly, or high-level language. There must be a program to convert the source code into object code so that your computer can understand it. This is the job of the language translator. The programmer creates source code and then converts it to machine-readable format (object ...

INTRODUCTION TO LANGUAGES

 Introduction to Languages: The basic components of a computer are: Input unit Central Processing Unit(CPU) Output unit The CPU is further divided into three parts-   Memory unit  Control unit  Arithmetic Logic unit      Most of us have heard that the CPU is called the brain of our computer because it accepts data, provides temporary memory space to it until it is stored(saved) on the hard disk, performs logical operations on it, and hence processes(here also means converts) data into information.       We all know that a computer consists of hardware and software. Software is a set of programs that performs multiple tasks together. An operating system is also software (system software) that helps humans to interact with the computer system.      A program is a set of instructions given to a computer to perform a specific operation. or computer is a computational device that is used to process data under the control of a com...