# Topic Nest > Explore. Learn. Share ## Posts - [Ohm's Law, Kirchhoff's Laws & Circuit Analysis for Beginners](https://topicnest.in/ohms-law-kirchhoffs-laws-circuit-analysis-for-beginners/): TopicNest  ›  Engineering  ›  Electronics & Electrical   |   April 2026   |   ⏱ 15 min read   |   Beginner–Intermediate ⚡ Quick Answer Ohm’s Law states that voltage (V) equals current (I) multiplied by resistance (R): V = IR. Kirchhoff’s Current Law (KCL) states that the total current entering a node equals the total current leaving it. Kirchhoff’s Voltage Law (KVL) states that the sum of all voltages around any closed loop in a circuit equals zero. Together, these three laws form the foundation of all circuit analysis. Introduction: The Three Laws That Power Every Circuit Every electronic device you use — your […] - [Data Structures Explained: Arrays, Linked Lists, Trees & Graphs](https://topicnest.in/data-structures-explained-arrays-linked-lists-trees-graphs/): ⚡ Quick Answer A data structure organises and stores data in memory for efficient access and modification. The four core types are Arrays (contiguous indexed storage), Linked Lists (dynamic node chains), Trees (hierarchical parent-child structures), and Graphs (networks of nodes and edges). Each has unique trade-offs in speed, memory, and use case. Introduction: Why Data Structures Matter Imagine trying to find a book in a library where every book is scattered randomly on the floor. Finding your book would take forever. But if the library organises books by genre, author, and title — your search becomes instant. That is precisely […] - [Top 10 Study Abroad Consultants in Nepal 2026](https://topicnest.in/top-10-study-abroad-consultants-in-nepal-2026/): Are you planning to study abroad from Nepal? Choosing the right overseas education consultant is one of the most important decisions you’ll make. The right consultant not only simplifies the university admission process, visa application, and test preparation, but also guides you through scholarships, pre‑departure briefings, and post‑arrival support. In this blog, we highlight the Top 10 Study Abroad Consultants in Nepal for 2026, based on reputation, experience, success rates, and student reviews — along with direct website links to explore their services.  1. Unicampus Global — Experienced Guidance & Strong University Network Website: https://myunicampus.com/ Unicampus Global is one of […] - [Best Countries for Post-Study Work Opportunities in 2025](https://topicnest.in/best-countries-for-post-study-work-opportunities-in-2025/): Studying abroad is not just about earning a degree—it’s also about building a global career. For many international students, the post-study work (PSW) opportunities available in a country are just as important as the quality of education. In 2025, with evolving immigration policies, changing job markets, and the rise of skill-based industries like AI, sustainability, and healthcare, certain countries are standing out as top destinations for graduates seeking long-term employment. In this blog, we’ll explore the best countries for post-study work opportunities in 2025, along with their visa options and career prospects. 1. Canada Canada continues to be one of […] - [Study in the UK: Your Complete Guide to Courses, Scholarships, and Opportunities](https://topicnest.in/study-in-the-uk/): Studying abroad is a dream for many students, and the United Kingdom (UK) consistently ranks among the most sought-after destinations for higher education. Known for its prestigious universities, vibrant culture, and globally recognized degrees, the UK offers international students a unique blend of academic excellence and life-changing opportunities. Whether you’re aiming for undergraduate, postgraduate, or research programs, studying in the UK can open doors to global career paths and personal growth. In this guide, we’ll walk you through everything you need to know about studying in the UK—right from choosing courses to securing scholarships, visas, and post-study work opportunities. Why […] - [Beam-penetration technique](https://topicnest.in/beam-penetration-technique/): The beam-penetration technique is an early method used for producing colored displays in CRT (Cathode Ray Tube) monitors. It was commonly applied in random-scan (vector scan) CRT systems before modern raster-scan and flat-panel displays became dominant. What is Beam-Penetration Technique? In this method, the screen is coated with multiple layers of phosphor materials (usually two – red and green). The electron beam’s velocity (or energy) is controlled to determine how deep it penetrates into the phosphor coating. Low-energy electrons excite the outer phosphor layer (typically red). High-energy electrons penetrate deeper, exciting the inner phosphor layer (typically green).By varying the beam’s […] - [program for man object moving](https://topicnest.in/program-for-man-object-moving/): In computer graphics, animation is created by displaying objects in different positions over time. A simple example is a man object moving across the screen using C graphics programming. This program uses the <graphics.h> library to draw a stick figure and simulate walking motion by updating its position step by step. #include <graphics.h> #include <conio.h> #include <dos.h> int main() { int gd = DETECT, gm; int x = 50, y = 300; // starting position of man initgraph(&gd, &gm, “”); for (int i = 0; i < 200; i++) { cleardevice(); // Head circle(x, y – 50, 20); // Body […] - [Computer-system operation](https://topicnest.in/computer-system-operation/): A computer system is a combination of hardware, software, and operating mechanisms that work together to execute tasks efficiently. Understanding how a computer system operates is essential for students, IT professionals, and researchers, as it explains the interaction between different components such as the CPU, memory, input/output devices, and operating system. What is Computer-System Operation? Computer-System Operation refers to the way different components of a computer collaborate to perform instructions. It involves: Fetching instructions from memory. Decoding them into understandable signals. Executing commands using the CPU and other hardware. Storing or outputting results for user interaction. This continuous cycle is […] - [Difference between Raster scan system and Random scan system](https://topicnest.in/difference-between-raster-scan-system-and-random-scan-system/): In computer graphics, display systems play a crucial role in how images are generated on a screen. Two of the most widely discussed techniques are the Raster Scan System and the Random Scan System. Both approaches are used to display images, but they differ significantly in their working principles, applications, and output quality. Understanding their differences is important for students, researchers, and professionals in the field of computer graphics. What is a Raster Scan System? A Raster Scan System is the most common display technique used in modern monitors, televisions, and computer screens. In this method, the electron beam moves […] - [program for simple animation of football goal](https://topicnest.in/program-for-simple-animation-of-football-goal/): #include <graphics.h> #include <conio.h> #include <dos.h> int main() { int gd = DETECT, gm; int x, y = 350; // Ball position initgraph(&gd, &gm, ""); // Draw Goal Post setcolor(WHITE); rectangle(450, 150, 550, 350); // Goal boundary line(450, 150, 500, 100); // Net top line(550, 150, 500, 100); // Animate Football for (x = 50; x <= 480; x += 10) { cleardevice(); // Draw Goal Again setcolor(WHITE); rectangle(450, 150, 550, 350); line(450, 150, 500, 100); line(550, 150, 500, 100); // Draw Football setcolor(YELLOW); setfillstyle(SOLID_FILL, YELLOW); fillellipse(x, y, 15, 15); delay(100); } // Final Message setcolor(GREEN); outtextxy(200, 400, "GOAL !!!"); […] - [Graphics program for man walking](https://topicnest.in/graphics-program-for-man-walking/): #include <graphics.h> #include <conio.h> #include <dos.h> int main() { int gd = DETECT, gm; int x, y = 300; // base Y position for walking initgraph(&gd, &gm, ""); for (x = 50; x <= 500; x += 10) { cleardevice(); // Draw ground line(0, y+50, getmaxx(), y+50); // Draw head setcolor(WHITE); circle(x, y-40, 15); // head // Draw body line(x, y-25, x, y+20); // Draw arms (swing effect using x position) if (x % 20 == 0) { line(x, y-15, x-20, y+10); // left arm forward line(x, y-15, x+20, y+10); // right arm backward } else { line(x, y-15, x+20, […] - [program for windmill rotation](https://topicnest.in/program-for-windmill-rotation/): #include <graphics.h> #include <conio.h> #include <math.h> #include <dos.h> #define PI 3.1416 int main() { int gd = DETECT, gm; int xc = 320, yc = 240; // center of rotation (windmill hub) int length = 100; // blade length float angle = 0; // rotation angle initgraph(&gd, &gm, ""); while (!kbhit()) { // loop until key pressed cleardevice(); // Draw tower setcolor(WHITE); line(xc, yc, xc, getmaxy()); // vertical stick line(xc-30, getmaxy(), xc+30, getmaxy()); // base // Draw hub (center circle) setfillstyle(SOLID_FILL, RED); fillellipse(xc, yc, 10, 10); // Draw 3 blades rotated by 120 degrees for (int i = 0; i […] - [Liquid Crystal Display](https://topicnest.in/liquid-crystal-display-lcd/): What is a Liquid Crystal Display (LCD)? A Liquid Crystal Display (LCD) is a flat-panel display technology widely used in electronic devices such as calculators, televisions, laptops, digital watches, and smartphones. It works by using the light-modulating properties of liquid crystals that do not emit light directly but instead use a backlight or reflector to produce visible images. How Does an LCD Work? The working principle of an LCD is based on the polarization of light and the alignment of liquid crystal molecules. Here’s a simplified breakdown: Backlight Source – Provides illumination. Polarizer Filters – Control the orientation of light […] - [Light Emitting Diode](https://topicnest.in/light-emitting-diode-led/): What is a Light Emitting Diode (LED)? A Light Emitting Diode (LED) is a semiconductor device that emits light when an electric current passes through it. Unlike traditional incandescent bulbs, LEDs do not rely on heating a filament. Instead, they produce light through a process called electroluminescence, making them more energy-efficient, durable, and long-lasting. How Does an LED Work? The working principle of LED is based on semiconductor physics: P-N Junction – The LED consists of a p-type and n-type semiconductor material. Electron-Hole Recombination – When a voltage is applied, electrons from the n-type combine with holes in the p-type […] - [Thin Film Electroluminescent Displays](https://topicnest.in/thin-film-electroluminescent-displays/): What are Thin Film Electroluminescent Displays (TFEL)? A Thin Film Electroluminescent Display (TFEL) is a flat-panel display technology that produces light by applying an electric field across a thin phosphor layer placed between two electrodes. Unlike LCDs (Liquid Crystal Displays) that rely on backlighting, TFELs are self-emissive, meaning they generate light directly, ensuring high brightness, wide viewing angles, and excellent visibility even in harsh environments. How Does a TFEL Display Work? The working principle of TFEL is based on electroluminescence: Structure – A thin phosphor film (commonly zinc sulfide doped with manganese) is sandwiched between two dielectric layers and transparent […] - [Plasma Panels displays](https://topicnest.in/plasma-panels-displays/): What is a Plasma Panel Display? A Plasma Panel Display (PDP) is a flat-panel display technology that uses ionized gases (plasma) to produce images. Each pixel in a plasma display consists of tiny cells filled with noble gases (neon, xenon) and a small amount of mercury. When an electric voltage is applied, these gases ionize into plasma, which excites phosphor coatings to emit red, green, or blue light. Plasma displays were once popular for large-screen televisions due to their excellent color accuracy, wide viewing angles, and high brightness. How Does a Plasma Display Work? The working principle of Plasma Display […] - [Flat Panel Display](https://topicnest.in/flat-panel-display/): What is a Flat Panel Display? A Flat Panel Display (FPD) is an advanced display technology used to present visual content in a slim, lightweight, and energy-efficient format. Unlike older Cathode Ray Tube (CRT) displays, flat panel displays do not rely on bulky vacuum tubes. Instead, they use modern electronic technologies such as liquid crystals, plasma, light-emitting diodes, and electroluminescence to produce images. Flat panel displays are widely used in televisions, computers, smartphones, tablets, medical devices, and industrial equipment because of their compact design, better resolution, and lower power consumption. Types of Flat Panel Displays Flat panel displays are broadly […] - [Shadow-mask technique](https://topicnest.in/shadow-mask-technique/): The shadow-mask technique is a widely used method in Cathode Ray Tube (CRT) displays and early color television systems. It plays a crucial role in producing sharp, vibrant images by ensuring that each electron beam strikes the correct color phosphor on the screen. What is the Shadow-Mask Technique? In CRT displays, three separate electron guns generate beams corresponding to the primary colors—red, green, and blue. The shadow mask, a thin metal sheet with tiny perforations, is placed just behind the phosphor-coated screen. These holes guide the electron beams so that each beam only excites its designated phosphor dots. The combination […] - [Raster-Scan Systems](https://topicnest.in/raster-scan-systems/): A Raster-Scan System is a method of displaying images on a screen by scanning them line by line from top to bottom. This is the most common technique used in CRT (Cathode Ray Tube) monitors, modern LCD/LED screens, and most televisions. In this system, the display is made up of pixels arranged in a rectangular grid, and the image is generated by controlling the intensity and colour of each pixel. How Raster-Scan Systems Work Pixel Grid Formation – The display area is divided into a matrix of pixels (picture elements). Horizontal Scanning – An electron beam moves left to right […] - [Raster Methods for Computer Animation](https://topicnest.in/raster-methods-for-computer-animation/): We can create simple animation sequences in our programs using real-time methods. We can produce an animation sequence on a raster-scan system one frame at a time, so that each completed frame could be saved in a file for later viewing. The animation can then be viewed by cycling through the completed frame sequence, or the frames could be transferred to film. If we want to generate an animation in real time, however, we need to produce the motion frames quickly enough so that a continuous motion sequence is displayed.  Because the screen display is generated from successively modified pixel […] - [Generating Animations Using Raster Operations](https://topicnest.in/generating-animations-using-raster-operations/):  We can also generate real-time raster animations for limited applications using block transfers of a rectangular array of pixel values.  A simple method for translating an object from one location to another in the xy plane is to transfer the group of pixel values that define the shape of the object to the new location Sequences of raster operations can be executed to produce realtime animation for either two-dimensional or three-dimensional objects, so long as we restrict the animation to motions in the projection plane. Then no viewing or visible-surface algorithms need be invoked. We can also animate objects along […] - [Design of Animation Sequences](https://topicnest.in/design-of-animation-sequences/): Animation sequence in general is designed in the following steps. 1. Storyboard layout 2. Object definitions. 3. Key-frame specifications 4. Generation of in-between frames.  This approach of carrying out animations is applied to any other applications as well, although some applications are exceptional cases and do not follow this sequence. For frame-by-frame animation, every frame of the display or scene is generated separately and stored. Later, the frame recording can be done and they might be displayed consecutively in terms of movie. The outline of the action is storyboard. This explains the motion sequence. The storyboard consists of a set […] - [OpenGL Point Functions](https://topicnest.in/opengl-point-functions/): ➢ The type within glBegin() specifies the type of the object and its value can be as follows: GL_POINTS ➢ Each vertex is displayed as a point. ➢ The size of the point would be of at least one pixel. ➢ Then this coordinate position, along with other geometric descriptions we may have in our scene, is passed to the viewing routines. ➢ Unless we specify other attribute values, OpenGL primitives are displayed with a default size and color. ➢ The default color for primitives is white, and the default point size is equal to the size of a single […] - [Graphics on Internet](https://topicnest.in/graphics-on-internet/): ✓ A great deal of graphics development is now done on the Internet. ✓ Computers on the Internet communicate using TCP/IP. ✓ Resources such as graphics files are identified by URL (Uniform resource locator). ✓ The World Wide Web provides a hypertext system that allows users to locate and view documents, audio and graphics. ✓ Each URL sometimes also called as universal resource locator. ✓ The URL contains two parts Protocol- for transferring the document, and Server contains the document. - [Graphics Networks](https://topicnest.in/graphics-networks/): ➔ So far, we have mainly considered graphics applications on an isolated system with a single user. ➔ Multiuser environments & computer networks are now common elements in many graphics applications. ➔ Various resources, such as processors, printers, plotters and data files can be distributed on a network & shared by multiple users. ➔ A graphics monitor on a network is generally referred to as a graphics server. ➔ The computer on a network that is executing a graphics application is called the client. ➔ A workstation that includes processors, as well as a monitor and input devices can function […] - [Advantages of video controller](https://topicnest.in/advantages-of-video-controller/): A video controller is a crucial component in any computer or multimedia device that manages the display of images, graphics, and videos on a screen. Often integrated into a graphics card or as part of a motherboard chipset, the video controller acts as a communication bridge between the system’s CPU and the display device. Its design and efficiency directly influence the quality, speed, and smoothness of visual output. 1. Enhanced Display Quality Modern video controllers support high resolutions and deep colour profiles, ensuring sharper images, vibrant colours, and realistic visuals. This is essential for applications such as gaming, graphic design, […] - [Video controller](https://topicnest.in/video-controller/): A video controller is a key hardware component in a computer or multimedia system responsible for managing the display of images, graphics, and videos on a screen. It acts as an interface between the CPU (Central Processing Unit) and the display device such as a monitor, projector, or VR headset. Often integrated into a graphics card or the motherboard, the video controller determines the quality, speed, and resolution of visual output. Functions of a Video Controller Image Processing – Converts digital data from the CPU into visual signals that can be displayed on the screen. Resolution & Colour Management – […] - [Touch Panels](https://topicnest.in/touch-panels/): ➢ Touch panels allow displayed objects or screen positions to be selected with the touch of a finger. ➢ Touch panel is used for the selection of processing options that are represented as a menu of graphical icons. ➢ Optical touch panel-uses LEDs along one vertical and horizontal edge of the frame. ➢ Acoustical touch panels generates high-frequency sound waves in horizontal and vertical directions across a glass plate. - [Joysticks](https://topicnest.in/joysticks/): ➢ Joystick is used as a positioning device,which uses a small vertical lever(stick) mounded on a base.It is used to steer the screen cursor around and select screen position with the stick movement. ➢ A push or pull on the stick is measured with strain gauges and converted to movement of the screen cursor in the direction of the applied pressure. - [Trackballs and Spaceballs](https://topicnest.in/trackballs-and-spaceballs/): ➢ A trackball is a ball device that can be rotated with the fingers or palm of the hand to produce screen cursor movement. ➢ Laptop keyboards are equipped with a trackball to eliminate the extra space required by a mouse. ➢ Spaceball is an extension of two-dimensional trackball concept. ➢ Spaceballs are used for three-dimensional positioning and selection operations in virtualreality systems,modeling,animation,CAD and other applications. - [Disadvantages of encoding](https://topicnest.in/disadvantages-of-encoding/): ❖ The disadvantages of encoding runs are that color changes are difficult to record and storage requirements increase as the lengths of the runs decrease. ❖ In addition, it is difficult for the display controller to process the raster when many short runs are involved. ❖ Moreover, the size of the frame buffer is no longer a major concern, because of sharp declines in memory costs - [Different methods to draw a curve](https://topicnest.in/different-methods-to-draw-a-curve/): Method 1: Using circle symmetry property, we generate the circle path with vertical spans in the octant from x = 0 to x = y, and then reflect pixel positions about the line y = x to y=0 Method 2: Another method for displaying thick curves is to fill in the area between two Parallel curve paths, whose separation distance is equal to the desired width. We could do this using the specified curve path as one boundary and setting up the second boundary either inside or outside the original curve path. This approach, however, shifts the original curve path […] - [Define Atomic Actions & explain its characteristics](https://topicnest.in/define-atomic-actions-explain-its-characteristics/): Typically, system activity is governed by the sequence of primitive or atomic operations it is executing. Usually, a machine level instruction, which is indivisible, instantaneous, and cannot be interrupted ( unless the system fails), corresponds to an atomic operation. However, it is desirable to be able to group such instructions that accomplish a certain task and make the group an atomic operation. Process P1 Process P2 — — — — Lock(X) Lock(X) X:=X+Z X:=X+Y; Unlock(X); Unlock(X); — — — — Failure Suppose P1 succeeds in locking X before P2, then P1 updates X and releases the lock, making it possible […] - [Write a program to find the frequency of presence of an element in an array](https://topicnest.in/write-a-program-to-find-the-frequency-of-presence-of-an-element-in-an-array/): #include<iostram.h> #include<iomanip.h> #include<conio.> class frequency{     private:          int n, m[100], ele, freq;     public:          void getdata();         void findfreq();         void display();      }; void frequency::getdata(){     cout<<"Enter the size of the array: ";     cin>>n;     cout<<"Enter "<<n<<" elemens into the array: ";     for(int i=0; i<n; i++)     cin>>m[i];     cout<<"Enter the search element: ";     cin>>ele; } void frequency::findfreq(){     freq = 0;     for (int i=0; i<n; i++)     if(m[i] == ele)     freq++; } void frequency::display(){     if(freq > 0)     count<<"Frequency of "<<ele<<" is "<<freq;     else     cout<<ele<<" does not exist"; } void main(){     frequency F;     clrscr();     F.getdata();     F.findfreq();     F.display();     getch(); }   OUTPUT: ------------------- Enter the size of the array: 5 Enter 5 elements into the array: 10 50 40 30 40 Enter the search element: 40 Frequency of 40 is 2 -------------------- ------------------- Enter the size of the array: 5 Enter 5 elements into the array: 10 50 40 30 40 Enter the search element: 35 25 does not exist -------------------- - [OpenGL Bézier-Spline Curve Functions](https://topicnest.in/opengl-bezier-spline-curve-functions/): We specify parameters and activate the routines for Bézier-curve display with the OpenGL functions glMap1* (GL_MAP1_VERTEX_3, uMin, uMax, stride, nPts, *ctrlPts); glEnable (GL_MAP1_VERTEX_3); We deactivate the routines with glDisable (GL_MAP1_VERTEX_3); where,  A suffix code of f or d is used with glMap1 to indicate either floating-point or doubleprecision for the data values. Minimum and maximum values for the curve parameter u are specified in uMin and uMax, although these values for a Bézier curve are typically set to 0 and 1.0, respectively. Bézier control points are listed in array ctrlPts number of elements in this array is given as a […] - [Program to illustrate a static data member & create 3 object & count the no. of object using static data member count](https://topicnest.in/program-to-illustrate-a-static-data-member-create-3-object-count-the-no-of-object-using-static-data/): #include<iostream.h> #include<conio.h>  class item{     ststic int count;     int number;     public:     void getdata(){         cin>>number;         count++;     }     void getcount(void)     {         cout<<"count:"<<count<<endl;     } }; int item::count; //-------Main Program--- int main(){     item a,b,c;     clrscr();     cout<<"----------\n";     cout<<"Before reading data\n";     a.getcount();     b.getcount();     c.getcount();     cout<<"----------------------------------\n";     cout<<"Enter value to object a\n";     a.getdata();     cout<<"Enter value to object b\n";     b.getdata();     cout<<"Enter value to object b\n";     c.getdata();     cout<<"----------------------------------\n";     cout<<"After reading data\n";     a.getcount();     b.getcount();     c.getcount();     cout<"\n--------------------------------------\n":     getch();     return 0; }   OUTPUT  ---------------------- Before reading data count:0 count:0 count:0 --------------------------- Enter value to object a 20 Enter value to object b 30 Enter value to object c 40 --------------------------- After reading data count:3 count:3 count:3 ----------------------- - [Program to sort a given array using bubble sort](https://topicnest.in/program-to-sort-a-given-array-using-bubble-sort/): Bubble sort is a simple sorting algorithm. The algorithm starts at the beginning of the data set. It compares the first two elements, and if the first is greater than the second, it swaps them. It continues doing this for each pair of adjacent elements to the end of the data set. It then starts again with the first two elements, repeating until no swaps have occurred on the last pass. Bubble sort can be used to sort a small number of items (where its inefficiency is not a high penalty). Bubble sort may also be efficiently used on a […] - [C++ program for the simple interest using dynamic initialization](https://topicnest.in/program-for-the-simple-interest-using-the-concept-of-dynamic-initialization-with-overloading-constructors/): #include<iostream.h> #include<conio.h> class SI{         int P, T;         float R, Interest;     Public:         SI(){         }     SI(int P1, int T1, float R1)     {         P=P1;         T=T1;         R=R1;         Interest=(P*T*R)/100;     }     float     {         return(Interest);     } }; //----------------------------------------- void main() {     SI s1;     int p,t;     float r;     clrscr();     cout<<"----------------------------------------\n";     cout<<"Enter the value for Principal amount:";     cin>>p;     cout<<"\n Enter the value for time:";     cin>>t;     cout<<"\n Enter the value for rate:";     cin>>r;     cout<<"\n ---------------------------------\n";     s1=SI(p,t,r);     cout<<"The Simple Interest ="<<s1.show()<<endl;     cout<<"--------------------------------------\n";     getch(); } OUTPUT: ----------------------------------- Enter the value for Principal amount: 4515 Enter the value for time: 5 Enter the value for rate: 10.8 ------------------------------------ The Simple Interest = 2438.100098 ------------------------------------ ----------------------------------- Enter the value for Principal amount: 3000 Enter the value for time: 4 Enter the value for rate: 5.5 ------------------------------------ The Simple Interest = 660 ------------------------------------ - [Program to sort a given array using selection sort](https://topicnest.in/program-to-sort-a-given-array-using-selection-sort/): Selection sort works by repeatedly finding the smallest (or largest) element from the unsorted part of the array and putting it in its correct position in the sorted part. Steps: Start with the first element (index 0) as the minimum. Compare it with every element in the unsorted part of the array to find the smallest value. Swap the smallest value with the current element. Move to the next index and repeat until the array is sorted. Example: Suppose we have the array: [29, 10, 14, 37, 13] Step-by-step: Pass 1: Smallest element in [29, 10, 14, 37, 13] is […] - [Program to search a number using Linear Search](https://topicnest.in/program-to-search-a-number-using-linear-search/): Linear search checks each element in the array one by one until the desired element is found or the array ends. Steps: Start from the first element. Compare the current element with the key (number to be searched). If it matches, return its position (index). If not, move to the next element. If the end of the array is reached without a match, the element is not present. Example:Array: [4, 8, 15, 16, 23, 42]Key: 23 Compare 4 → No match Compare 8 → No match Compare 15 → No match Compare 16 → No match Compare 23 → Match […] - [Untold Stories of 5 Famous Paintings That Changed Art Forever](https://topicnest.in/untold-stories-of-5-famous-paintings-that-changed-art-forever/): Art is not just color on canvas — it’s emotion, history, mystery, and a glimpse into the artist’s soul. Behind every famous painting lies a story — sometimes beautiful, sometimes tragic, and often surprising. In this blog, we’ll uncover the fascinating stories behind some of the world’s most celebrated masterpieces. 1. Mona Lisa – Leonardo da Vinci The Mona Lisa, painted by Leonardo da Vinci, is the most famous portrait in the world. But did you know her smile is still a mystery? Some believe she is smiling with joy, others say it’s sadness. Many also wonder about her true […] - [ನಾನು ದೊಡ್ಡವನಾದಾಗ ಏನು ಆಗಲು ಇಚ್ಛಿಸುತ್ತೇನೆ](https://topicnest.in/%e0%b2%a8%e0%b2%be%e0%b2%a8%e0%b3%81-%e0%b2%a6%e0%b3%8a%e0%b2%a1%e0%b3%8d%e0%b2%a1%e0%b2%b5%e0%b2%a8%e0%b2%be%e0%b2%a6%e0%b2%be%e0%b2%97-%e0%b2%8f%e0%b2%a8%e0%b3%81-%e0%b2%86%e0%b2%97%e0%b2%b2/): ೧. ವೈದ್ಯ (Doctor) ನಾವು ಬೆಳೆದು ದೊಡ್ಡವರಾದ ಮೇಲೆ ಏನಾಗಬೇಕು ಎಂದು ಪ್ರತಿಯೊಬ್ಬರಿಗೂ ಒಂದು ಕನಸು ಇರುತ್ತದೆ. ನಾನು ವೈದ್ಯನಾಗಬೇಕು/ವೈದ್ಯಳಾಗಬೇಕು ಅಂದುಕೊಂಡಿದ್ದೇನೆ. ನಾನು ಬೆಳೆದು ದೊಡ್ಡವನಾದ ಮೇಲೆ, ವೈದ್ಯನಾಗಲು ಬಯಸುತ್ತೇನೆ. ವೈದ್ಯರು ಅನಾರೋಗ್ಯದಿಂದ ಬಳಲುತ್ತಿರುವ ಅಥವಾ ಗಾಯಗೊಂಡ ಜನರಿಗೆ ಚಿಕಿತ್ಸೆ ನೀಡಿ ಗುಣಪಡಿಸುತ್ತಾರೆ. ನಾನು ರೋಗಿಗಳ ಮಾತನ್ನು ಕೇಳುವ, ಅವರಿಗೆ ಉತ್ತಮ ಚಿಕಿತ್ಸೆ ನೀಡುವ ದಯೆ ಮತ್ತು ಕಾಳಜಿಯುಳ್ಳ ವೈದ್ಯನಾಗಲು ಬಯಸುತ್ತೇನೆ. ವೈದ್ಯರು ಜೀವಗಳನ್ನು ಉಳಿಸುವುದರಿಂದ ಅವರು ಬಹಳ ಮುಖ್ಯ ಎಂದು ನಾನು ಭಾವಿಸುತ್ತೇನೆ. ಕೆಲವೊಮ್ಮೆ ಜನರಿಗೆ ರೋಗಗಳು ಬರುತ್ತವೆ ಅಥವಾ ಅಪಘಾತಗಳಾಗುತ್ತವೆ, ಆಗ ವೈದ್ಯರು ಅವರನ್ನು ಹೇಗೆ ಗುಣಪಡಿಸಬೇಕು ಎಂದು ತಿಳಿದಿರುತ್ತಾರೆ. ಉತ್ತಮ ಚಿಕಿತ್ಸೆ ಪಡೆಯಲು ಸಾಧ್ಯವಾಗದ ಬಡ ಜನರಿಗೆ ಸಹಾಯ ಮಾಡಲು ನಾನು ಬಯಸುತ್ತೇನೆ. ಅವರಿಗೆ ಸಹಾಯ ಮಾಡಲು ನಾನು ಉಚಿತ ಆರೋಗ್ಯ ಶಿಬಿರಗಳು ಮತ್ತು ಚಿಕಿತ್ಸಾಲಯಗಳಲ್ಲಿ ಸ್ವಯಂಸೇವಕನಾಗಿ ಕೆಲಸ ಮಾಡುತ್ತೇನೆ. ವೈದ್ಯಕೀಯ ಕಾಲೇಜಿಗೆ ಸೇರಲು ನಾನು ಶಾಲೆಯಲ್ಲಿ, ವಿಶೇಷವಾಗಿ ವಿಜ್ಞಾನ ಮತ್ತು ಜೀವಶಾಸ್ತ್ರದಲ್ಲಿ ಚೆನ್ನಾಗಿ ಓದುತ್ತೇನೆ. ವೈದ್ಯನಾಗುವುದು […] - [What I Want to Be When I Grow Up](https://topicnest.in/what-i-want-to-be-when-i-grow-up/): 1. Doctor Everyone has a dream of what they want to become when they grow up. I want to become a doctor. When I grow up, I want to be a doctor. Doctors help people feel better when they are sick or hurt. I want to be a kind and caring doctor who listens to patients and gives them the best treatment. I think doctors are very important because they save lives. Sometimes people get diseases or meet with accidents, and doctors know how to make them better. I also want to help poor people who cannot afford good treatment. […] - [How to Build Effective Study Habits for Long-Term Success](https://topicnest.in/how-to-build-effective-study-habits-for-long-term-success/): Developing effective study habits for students is not just about getting good grades — it’s about setting yourself up for long-term success in academics and beyond. Whether you’re in school, college, or pursuing lifelong learning, strong study habits help you retain knowledge, manage your time, and reduce stress. In this guide, we’ll explore actionable tips to help you create a productive study routine and improve your academic performance. 1. Set Clear and Achievable Goals Start by defining what you want to achieve. Break long-term academic goals into short-term targets. Tip:Use the SMART method (Specific, Measurable, Achievable, Relevant, Time-bound) to set […] - [Immunity booster drinks for rainy season](https://topicnest.in/immunity-booster-drinks-for-rainy-season/): 1. Golden Turmeric Milk (Haldi Doodh) Ingredients: 1 cup warm milk (dairy or plant-based) ½ tsp turmeric powder ¼ tsp black pepper (enhances absorption of curcumin) 1 tsp honey (optional) A pinch of cinnamon (optional) How to Make: Warm the milk and stir in turmeric, black pepper, and cinnamon. Simmer for 2–3 minutes. Remove from heat, cool slightly, and add honey before drinking. Benefits: Fights inflammation, builds immunity, aids better sleep. 2. Lemon Ginger Honey Tea Ingredients: 1½ cups water 1-inch piece of fresh ginger (sliced) ½ lemon 1 tsp honey How to Make: Boil water with ginger for 5 […] - [Top Immunity-Boosting Foods to Eat During the Rainy Season](https://topicnest.in/top-immunity-boosting-foods-to-eat-during-the-rainy-season/): The rainy season brings refreshing showers, cool breezes—and unfortunately, a higher risk of infections. From flu and cold to stomach infections and dengue, the damp and humid weather creates the perfect breeding ground for bacteria and viruses. That’s why boosting your immune system is essential during this time. Your diet plays a major role in building your body’s natural defenses. In this blog, we’ll explore the top immunity-boosting foods you should include in your rainy season diet to stay healthy and protected. 1. Turmeric (Haldi) Turmeric is packed with curcumin, a powerful anti-inflammatory and antioxidant compound. It helps fight infections […] - [10 Proven Benefits of Daily Meditation](https://topicnest.in/10-proven-benefits-of-daily-meditation/): In our fast-moving, always-on world, taking a few minutes to pause and breathe can make a world of difference. Daily meditation isn’t just a spiritual trend—it’s a science-backed habit with powerful effects on your mind and body. Whether you’re just starting out or have been practicing for years, understanding the benefits of daily meditation can help you stay motivated and consistent. Let’s explore the top 10 benefits of making meditation a daily habit: 1. Reduces Stress Naturally To begin with, one of the most widely recognized benefits of daily meditation is its ability to lower stress levels. When you meditate, […] - [Classical Problem on Synchronization](https://topicnest.in/classical-problem-on-synchronization-2/): There are various types of problem which are proposed for synchronization scheme such as Bounded Buffer Problem: This problem was commonly used to illustrate the power of synchronization primitives. In this scheme we assumed that the pool consists of ‗N‘ buffer and each capable of holding one item. The ‗mutex‘ semaphore provides mutual exclusion for access to the buffer pool and is initialized to the value one. The empty and full semaphores count the number of empty and full buffer respectively. The semaphore empty is initialized to ‗N‘ and the semaphore full is initialized to zero. This problem is known […] - [Process control block](https://topicnest.in/process-control-block-2/): Each process is represented in the OS by a process control block. It is also by a process control block. It is also known as task control block. A process control block contains many pieces of information associated with a specific process. It includes the following informations. Process state: The state may be new, ready, running, waiting or terminated state. Program counter: it indicates the address of the next instruction to be executed for this purpose. CPU registers: The registers vary in number & type depending on the computer architecture. It includes accumulators, index registers, stack pointer & general purpose […] - [Schedulers](https://topicnest.in/scheduler/): A process migrates between the various scheduling queues throughout its life-time purposes. The OS must select for scheduling processes from these queues in some fashion. This selection process is carried out by the appropriate scheduler. In a batch system, more processes are submittedand then executed immediately. So these processes are spooled to a mass storage device like disk, where they are kept for later execution Types of schedulers: There are 3 types of schedulers mainly used 1. Long term scheduler: Long term scheduler selects process from the disk & loads them into memory for execution. It controls the degreeof multi-programming […] - [Process scheduling](https://topicnest.in/process-scheduling/): Scheduling is a fundamental function of OS. When a computer is multiprogrammed, it has multiple processes completing for the CPU at the same time. If only one CPU is available, then a choice has to be made regarding which process to execute next. This decision making process is known as scheduling and the part of the OS that makes this choice is called a scheduler. The algorithm it uses in making this choice is called scheduling algorithm Scheduling queues: As processes enter the system, they are put into a job queue. This queue consists of all process in the system. […] - [Process Management](https://topicnest.in/processmanagement/): Process: A process or task is an instance of a program in execution. The execution of a process must programs in a sequential manner. At any time at most one instruction is executed. The process includes the current activity as represented by the value of the program counter and the content of the processors registers. Also it includes the process stack which contain temporary data (such as method parameters return address and local variables) & a data section which contain global variables. Difference between process & program: A program by itself is not a process. A program in execution is […] - [Parameter Passing Techniques](https://topicnest.in/parameter-passing-techniques/): When writing functions in C, one key concept every programmer must understand is how parameters are passed. This affects whether your function works with a copy of data or directly modifies the original variable. In C, there are two main parameter passing techniques:  1. Pass by Value (Default in C) Pass by value means the function receives a copy of the variable’s value. Any changes made inside the function do not affect the original variable. #include <stdio.h> void changeValue(int a) { a = 50; } int main() { int x = 10; changeValue(x); printf("x = %d\n", x); // Output: x […] - [Program to print series from 10 to 1 using nested loops](https://topicnest.in/10-to-1-nested-loops/): What Are Nested Loops? In C programming, nested loops refer to using one loop inside another loop. The inner loop runs completely for each iteration of the outer loop. for (int i = 1; i <= n; i++) { // Outer loop for (int j = 1; j <= m; j++) { // Inner loop // code to execute } } Nested loops are commonly used for: Printing patterns Traversing matrices or grids Repeating a task multiple times in a structured way C Program to Print Series from 10 to 1 Using Nested Loops Let’s now use nested loops to […] - [Program to print the sum of 1st N natural numbers](https://topicnest.in/program-to-print-the-sum-of-1st-n-natural-numbers/): What are Natural Numbers? Natural numbers are positive integers starting from 1, 2, 3, and so on. The sum of the first N natural numbers can be calculated using a loop or using the formula: Sum = n(n+1)/2 #include<stdio.h> int main() { int n,i,sum=0; printf("Enter the limit: "); scanf("%d", &n); for(i=1;i<=n;i++) { sum = sum +i; } printf("Sum of N natural numbers is: %d",sum); } Output Enter the limit: 5 Sum of N natural numbers is 15 Explanation: The user is prompted to enter the value of N. A for loop runs from 1 to N. Each number is added […] - [C program to add all the numbers entered by a user until user enters 0](https://topicnest.in/c-program-to-add-all-the-numbers-entered-by-a-user-until-user-enters-0/): This program repeatedly asks the user to enter a number. The loop continues adding the numbers until the user enters 0. Once 0 is entered, the program displays the total sum. #include int main() { int num, sum = 0; printf("Enter numbers to add (Enter 0 to stop):\n"); while (1) { scanf("%d", &num); if (num == 0) { break; // Exit the loop when 0 is entered } sum += num; // Add the number to sum } printf("The total sum is: %d\n", sum); return 0; } OUTPUT Enter numbers to add (Enter 0 to stop): 5 10 -3 0 […] - [Basic Functions of Operation System](https://topicnest.in/basic-functions-of-operation-system/): The various functions of operating system are as follows: 1. Process Management: A program does nothing unless their instructions are executed by a CPU.A process is a program in execution. A time shared user program such as a compiler is a process. A word processing program being run by an individual user on a pc is a process.  A system task such as sending output to a printer is also a process. A process needs certain resources including CPU time, memory files & I/O devices to accomplish its task. These resources are either given to the process when it is […] - [Top 10 Cyber Crime Prevention Tips](https://topicnest.in/top-10-cyber-crime-prevention-tips/): 1. Use Strong Passwords Use different user ID / password combinations for different accounts and avoid writing them down. Make the passwords more complicated by combining letters, numbers, special characters (minimum 10 characters in total) and change them on a regular basis. 2. Secure your computer Activate your firewall Firewalls are the first line of cyber defence; they block connections to unknown or bogus sites and will keep out some types of viruses and hackers. Use anti-virus/malware software Prevent viruses from infecting your computer by installing and regularly updating anti-virus software. Block spyware attacks Prevent spyware from infiltrating your computer […] - [Computer security](https://topicnest.in/computer-security/): Computer security is security applied to computing devices such as computers and smartphones, as well as computer networks such as private and public networks, including the whole Internet. The field covers all the processes and mechanisms by which digital equipment, information and services are protected from unintended or unauthorized access, change or destruction, and are of growing importance in line with the increasing reliance on computer systems of most societies worldwide. It includes physical security to prevent theft of equipment, and information security to protect the data on that equipment. It is sometimes referred to as “cyber security” or “IT […] - [Recovery from Deadlock](https://topicnest.in/recovery-from-deadlock-2/): When a detection algorithm determines that a deadlock exists, several alternatives exist. One possibility is to inform the operator that a deadlock has occurred, and to let the operator deal with the deadlock manually. The other possibility is to let the system recover from the deadlock automatically. There are two options for breaking a deadlock. One solution is simply to abort one or more processes to break the circular wait. The second option is to preempt some resources from one or more of the deadlocked processes. Process Termination: To eliminate deadlocks by aborting a process, we use one of two […] - [Safety Algorithm](https://topicnest.in/safety-algorithm-2/): 1. Let Workand Finish be vectors of length m and n, respectively. Initialize: Work = Available Finish [i] = false for i = 0, 1, …,n- 1. 2. Find and i such that both: (a) Finish [i] = false (b) Needi Work If no such i exists, go to step 4. 3. Work = Work + Allocationi Finish[i] = true go to step 2. 4. If Finish [i] == true for all i, then the system is in a safe state. - [Banker’s Algorithm](https://topicnest.in/bankers-algorithm-2/): This algorithm can be used in banking system to ensure that the bank never allocates all its available cash such that it can no longer satisfy the needs of all its customer. This algorithm is applicable to a system with multiple instances of each resource type. When a new process enter in to the system it must declare the maximum number of instances of each resource type that it may need. This number may not exceed the total number of resources in the system. Several data structure must be maintained to implement the banker‘s algorithm. Let, n = number of […] - [Deadlock Prevention](https://topicnest.in/deadlock-prevention/): Deadlock prevention is a set of methods for ensuring that at least one of these necessary conditions cannot hold. Mutual Exclusion: The mutual exclusion condition holds for non sharable. The example is a printer cannot be simultaneously shared by several processes. Sharable resources do not require mutual exclusive access and thus cannot be involved in a dead lock. The example is read only files which are in sharing condition. If several processes attempt to open the read only file at the same time they can be guaranteed simultaneous access. Hold and wait:To ensure that the hold and wait condition never […] - [Semaphores](https://topicnest.in/semaphores-2/): For the solution to the critical section problem one synchronization tool is used which is known as semaphores. A semaphore ‗S‘ is an integer variable which is accessed through two standard operations such as wait and signal. These operations were originally termed ‗P‘ (for wait means to test) and ‗V‘ (for single means to increment). The classical definition of wait is Wait (S) { While (S <= 0) { Test; } S--; } The classical definition of the signal is Signal (S) { S++; } In case of wait the test condition is executed with interruption and the decrement is […] - [Critical Section Problem](https://topicnest.in/critical-section-problem/): Consider a system consisting of n processes (P0, P1, ………Pn -1 ) each process has a segment of code which is known as critical section in which the process may be changing common variable, updating a table, writing a file and so on. The important feature of the system is that when the process is executing in its critical section no other process is to be allowed to execute in its critical section. The execution of critical sections by the processes is a mutually exclusive. The critical section problem is to design a protocol that the process can use to […] - [Operating System Services](https://topicnest.in/operatingsystem-services/): An operating system provides an environment for the execution of the program. It provides some services to the programs. The various services provided by an operating system are as follows: Program Execution: The system must be able to load a program into memory and to run that program. The program must be able to terminate this execution either normally or abnormally. I/O Operation: A running program may require I/O. This I/O may involve a file or a I/O device for specific device. Some special function can be desired. Therefore the operating system must provide a means to do I/O. File […] - [Virtual Machines](https://topicnest.in/virtualmachines/): By using CPU scheduling & virtual memory techniques an operating system can create the illusion of multiple processes, each executing on its own processors & own virtual memory. Each processor is provided a virtual copy of the underlying computer. The resources of the computer are shared to create the virtual machines. CPU scheduling can be used to create the appearance that users have their own processor. Implementation: Although the virtual machine concept is useful, it is difficult to implement since much effort is required to provide an exact duplicate of the underlying machine. The CPU is being multiprogrammed among several […] - [System structure](https://topicnest.in/system-structure/): Simple structure There are several commercial system that don‘t have a well- defined structure such operating systems begins as small, simple & limited systems and then grow beyond their original scope. MS-DOS is an example of such system. It was not divided into modules carefully. Another example of limited structuring is the UNIX operating system. Layered approach In the layered approach, the OS is broken into a number of layers (levels) each built on top of lower layers. The bottom layer (layer o ) is the hardware & top most layer (layer N) is the user interface. The main advantage […] - [System Programs](https://topicnest.in/systemprograms/): System programs provide a convenient environment for program development & execution. They are divided into the following categories. File manipulation: These programs create, delete, copy, rename, print & manipulate files and directories. Status information: Some programs ask the system for date, time & amount of available memory or disk space, no. of users or similar status information. File modification: Several text editors are available to create and modify the contents of file stored on disk. Programming language support: compliers, assemblers & interpreters are provided to the user with the OS. Programming loading and execution: Once a program is assembled or […] - [System Calls](https://topicnest.in/system-call/): System calls provide the interface between a process & the OS. These are usually available in the form of assembly language instruction. Some systems allow system calls to be made directly from a high level language program like C, BCPL and PERL etc. systems calls occur in different ways depending on the computer in use. System calls can be roughly grouped into 5 major categories. 1. Process Control: End, abort: A running program needs to be able to has its execution either normally (end) or abnormally (abort). Load, execute: A process or job executing one program may want to load […] - [Basic Functions of Operation System](https://topicnest.in/functions-operation-system/): The various functions of the operating system are as follows: 1. Process Management: A program does nothing unless its instructions are executed by a CPU. A process is a program in execution. A time-shared user program such as a compiler is a process. A word processing program being run by an individual user on a pc is a process. A system task such as sending output to a printer is also a process. A process needs certain resources including CPU time, memory files & I/O devices to accomplish its task. These resources are either given to the process when it […] - [Write a C program to read name and marks of n number of students from user and store them in a file. If the file previously exits, add the information of n students](https://topicnest.in/read-name-and-marks/): #include <stdio.h> int main() { char name[50]; int marks, i,n; printf(“Enter number of students”); scanf(“%d”, &n); FILE *fptr; fptr=(fopen(“C:\\student.txt”,”a”)); if (fptr==NULL){ printf("Error!"); exit(1); } for(i=0;i<n;++i) { printf("For student%d\nEnter name: ",i+1); scanf("%s",name); printf(“Enter marks”); scanf(“%d”, &marks); fprintf(fptr, “\nName: %s\nMarks=%d\n”, name, marks); } fclose(fptr); Return 0; } The fclose function causes the stream pointed to be flushed and the associated file to be closed. Any unwritten buffered data for the stream are delivered to the host environment to be written to the file; any unread buffered data are discarded. The stream is disassociated from the file. If the associated buffer was automatically […] - [Write a program to open a file using fopen()](https://topicnest.in/write-a-program-to-open-a-file-using-fopen/): #include<stdio.h> void main() { fopen() file *fp; fp=fopen(“student.DAT”, “r”); if(fp==NULL) { printf(“The file could not be open”); exit(0); } - [program to find the largest of n numbers and its location in an array](https://topicnest.in/write-a-program-to-find-the-largest-of-n-numbers-and-its-location-in-an-array/): #include<stdio.h> int main() { int n, i, max, position; // Ask user for the number of elements printf("Enter the number of elements: "); scanf("%d", &n); int arr[n]; // Input array elements printf("Enter %d numbers:\n", n); for (i = 0; i < n; i++) { scanf("%d", &arr[i]); } // Initialize max and position max = arr[0]; position = 0; // Find the maximum and its position for (i = 1; i < n; i++) { if (arr[i] > max) { max = arr[i]; position = i; } } // Output the result printf("The largest number is %d at position %d (index […] - [Write a C program to pass an array containing age of person to a function](https://topicnest.in/write-a-c-program-to-pass-an-array-containing-age-of-person-to-a-function/): #include <stdio.h> // Function prototype void displayAges(int ages[], int size); int main() { int ages[5]; // Array to hold ages int i; // Input ages printf("Enter the age of 5 persons:\n"); for (i = 0; i < 5; i++) { printf("Person %d: ", i + 1); scanf("%d", &ages[i]); } // Call the function and pass the array displayAges(ages, 5); return 0; } // Function to display ages void displayAges(int ages[], int size) { printf("\nAges of persons are:\n"); for (int i = 0; i < size; i++) { printf("Person %d: %d years\n", i + 1, ages[i]); } } - [Program for multiplication of two matrices](https://topicnest.in/program-for-multiplication-of-two-matrices/): #include <stdio.h> int main() { int a[10][10], b[10][10], result[10][10]; int i, j, k, r1, c1, r2, c2; // Input rows and columns for first matrix printf("Enter rows and columns for first matrix: "); scanf("%d %d", &r1, &c1); // Input rows and columns for second matrix printf("Enter rows and columns for second matrix: "); scanf("%d %d", &r2, &c2); // Check if multiplication is possible if (c1 != r2) { printf("Matrix multiplication not possible. Columns of first matrix must equal rows of second matrix.\n"); return 1; } // Input first matrix printf("Enter elements of first matrix:\n"); for (i = 0; i < […] - [Write a C program to find sum of two matrices](https://topicnest.in/write-a-c-program-to-find-sum-of-two-matrices/) - [C program to accept N numbers and arrange them in an ascending order](https://topicnest.in/c-program-to-accept-n-numbers-and-arrange-them-in-an-ascending-order/): #include <stdio.h> int main() { int arr[100], n, i, j, temp; // Accept total number of elements printf("Enter the number of elements: "); scanf("%d", &n); // Accept array elements printf("Enter %d numbers:\n", n); for (i = 0; i < n; i++) { scanf("%d", &arr[i]); } // Sort using Bubble Sort for (i = 0; i < n - 1; i++) { for (j = 0; j < n - i - 1; j++) { if (arr[j] > arr[j + 1]) { // Swap arr[j] and arr[j+1] temp = arr[j]; arr[j] = arr[j + 1]; arr[j + 1] = temp; } […] - [C Program to Print the Alternate Elements in an Array](https://topicnest.in/c-program-to-print-the-alternate-elements-in-an-array/): #include <stdio.h> int main() { int arr[100], n, i; // Accept number of elements printf("Enter the number of elements: "); scanf("%d", &n); // Accept array elements printf("Enter %d elements:\n", n); for (i = 0; i < n; i++) { scanf("%d", &arr[i]); } // Print alternate elements (0th, 2nd, 4th, ...) printf("Alternate elements in the array:\n"); for (i = 0; i < n; i += 2) { printf("%d ", arr[i]); } printf("\n"); return 0; } - [C Program to Increment every Element of the Array by one & Print Incremented Array.](https://topicnest.in/c-program-to-increment-every-element-of-the-array-by-one-print-incremented-array/): #include <stdio.h> int main() { int arr[100], n, i; // Input number of elements printf("Enter the number of elements in the array: "); scanf("%d", &n); // Input array elements printf("Enter %d elements:\n", n); for (i = 0; i < n; i++) { scanf("%d", &arr[i]); } // Increment each element by 1 for (i = 0; i < n; i++) { arr[i] = arr[i] + 1; } // Print the incremented array printf("Array after incrementing each element by 1:\n"); for (i = 0; i < n; i++) { printf("%d ", arr[i]); } printf("\n"); return 0; } - [Write a program to print Fibonacci Series upto a given number of terms](https://topicnest.in/write-a-program-to-print-fibonacci-series-upto-a-given-number-of-terms/): The Fibonacci series is a sequence of integers in which the first two integers are 1 and from third integer onwards each integer is the sum of the previous two integers of the sequence i.e. 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ………………………….. The program which implements the above logic is as follows: #include<stdio.h> int Fibonacci(int); void main() { int term,i; printf(“Enter the number of terms of Fibonacci Series which is going to be printed”); scanf(“%d”,&term); for(i=0;i<term;i++) { printf(“%d”,Fibonacci(i)); } } int Fibonacci(int x) { if(x==0 || x==1) return 1; else return (Fibonacci(x-1) + Fibonacci(x-2)); } […] - [Write a program to find GCD of two numbers](https://topicnest.in/gcd-of-two-numbers/): The GCD or HCF (Highest Common Factor) of two integers is the greatest integer that divides both the integers with remainder equals to zero. This can be illustrated by Euclid’s remainder Algorithm which states that GCD of two numbers say x and y i.e. GCD(x, y) = x if y is 0 = GCD(y, x%y) otherwise The program which implements the previous logic is as follows: #include int GCD(int,int); void main() { int a,b,gcd; printf(“Enter two numbers”); scanf(“%d%d”,&a,&b); gcd=GCD(a,b); printf(“GCD of %d and %d is %d”,a,b,gcd); } int GCD(int x, int y) { if(y==0) return x; else return GCD(y,x%y); } […] - [Write a program using recursion to find power of a number](https://topicnest.in/write-a-program-using-recursion-to-find-power-of-a-number/): We can write, nm = n*nm-1 =n*n*nm-2 =n*n*n*……………m times *nm-m The program which implements the above logic is as follows: #include<stdio.h> int power(int,int); void main() { int n,m,k; printf(“Enter the value of n and m”); scanf(“%d%d”,&n,&m); k=power(n,m); printf(“The value of nm for n=%d and m=%d is %d”,n,m,k); } int power(int x, int y) { if(y==0) { return 1; } else { return(x*power(x,y-1)); } } Output: Enter the value of n and m 3 5 The value of nm for n=3 and m=5 is 243 - [Write a program using recursion to find the summation of numbers from 1 to n](https://topicnest.in/write-a-program-using-recursion-to-find-the-summation-of-numbers-from-1-to-n/): We can say ‘sum of numbers from 1 to n can be represented as sum of numbers from 1 to n1 plus n’ i.e. The sum of numbers from 1 to n = n + Sum of numbers from 1 to n-1 = n + n-1 + Sum of numbers from 1 to n-2 = n+ n-1 + n-2 + ……………. +1 The program which implements the above logic is as follows: [wp_ad_camp_1] #include void main() { int n,s; printf(“Enter a number”); scanf(“%d”,&n); s=sum(n); printf(“Sum of numbers from 1 to %d is %d”,n,s); } int sum(int m) int r; if(m==1) […] - [Write a program using function to find factorial of a number](https://topicnest.in/write-a-program-using-function-to-find-factorial-of-a-number/): #include <stdio.h> // Function to calculate factorial int factorial(int n) { int fact = 1; for(int i = 1; i <= n; i++) { fact *= i; } return fact; } int main() { int num; printf("Enter a positive integer: "); scanf("%d", &num); if(num < 0) { printf("Factorial is not defined for negative numbers.\n"); } else { int result = factorial(num); printf("Factorial of %d is %d\n", num, result); } return 0; } - [Actual Arguments And Formal Arguments](https://topicnest.in/actual-arguments-and-formal-arguments/): Actual Arguments These are the real values or variables you pass to a function when calling it. They appear in the function call. int main() { int a = 10, b = 20; add(a, b); // a and b are actual arguments return 0; } Formal Arguments These are the placeholders or parameters defined in the function definition. They receive the values of actual arguments. void add(int x, int y) { printf("Sum = %d\n", x + y); // x and y are formal arguments } - [Program using a nested for loop to find the prime numbers from 2 to 20](https://topicnest.in/program-using-a-nested-for-loop-to-find-the-prime-numbers-from-2-to-20/): #include <stdio.h> int main() { int i, j, isPrime; printf("Prime numbers from 2 to 20 are:\n"); for (i = 2; i <= 20; i++) { // Outer loop: check each number from 2 to 20 isPrime = 1; // Assume i is prime for (j = 2; j < i; j++) { // Inner loop: check if i is divisible by any number less than i if (i % j == 0) { isPrime = 0; // Not a prime number break; // No need to check further } } if (isPrime) { printf("%d ", i); // Print prime number […] - [C Program to find the reverse of a number](https://topicnest.in/c-program-to-find-the-reverse-of-a-number/): #include <stdio.h> int main() { int num, reversed = 0, remainder; // Input from user printf("Enter an integer: "); scanf("%d", &num); while (num != 0) { remainder = num % 10; // Get the last digit reversed = reversed * 10 + remainder; // Build the reversed number num = num / 10; // Remove the last digit } printf("Reversed number: %d\n", reversed); return 0; }   Output: Enter an integer: 1234 Reversed number: 4321   Explanation: The program uses a while loop to extract the last digit of the number using the modulus operator %. It then multiplies the […] - [Program to count the no of digits in a number](https://topicnest.in/program-to-count-the-no-of-digits-in-a-number/): Counting the number of digits in a number is a common beginner-level program in C. This helps in understanding how to use loops and arithmetic operations like division. #include <stdio.h> int main() { int num, count = 0; // Input from user printf("Enter a number: "); scanf("%d", &num); // Handle 0 separately if (num == 0) { count = 1; } else { while (num != 0) { num = num / 10; // Remove the last digit count++; // Increment digit count } } printf("Number of digits: %d\n", count); return 0; } OUTPUT Enter a number: 12345 Number of […] - [Program to check whether a given number is a palindrome or not](https://topicnest.in/palindrome-or-not/): A number is called a palindrome if it reads the same backward as forward. Examples: 121, 1331, 454 are palindrome numbers. #include int main() { int num, original, reversed = 0, remainder; // Input from user printf("Enter a number: "); scanf("%d", &num); original = num; // Store original number // Reverse the number while (num != 0) { remainder = num % 10; reversed = reversed * 10 + remainder; num = num / 10; } // Check if palindrome if (original == reversed) { printf("%d is a palindrome number.\n", original); } else { printf("%d is not a palindrome number.\n", […] - [Program to enter a grade & check its corresponding remarks](https://topicnest.in/program-to-enter-a-grade-check-its-corresponding-remarks/): This program accepts a grade as input (like A, B, C, etc.) and displays the corresponding remark using conditional statements. This is a good practice for learning if-else or switch-case in C. #include <stdio.h> int main() { char grade; // Input from user printf("Enter your grade (A, B, C, D, F): "); scanf(" %c", &grade); // Note the space before %c to consume newline // Convert lowercase to uppercase (optional) if (grade >= 'a' && grade <= 'z') { grade = grade - 32; } // Check remarks if (grade == 'A') { printf("Excellent!\n"); } else if (grade == 'B') […] - [Write a program to check for the relation between 2 nos](https://topicnest.in/write-a-program-to-check-for-the-relation-between-2-nos-2/): #include <stdio.h> int main() { int num1, num2; // Input two numbers from user printf("Enter first number: "); scanf("%d", &num1); printf("Enter second number: "); scanf("%d", &num2); // Check and display the relationship if (num1 > num2) { printf("%d is greater than %d\n", num1, num2); } else if (num1 < num2) { printf("%d is less than %d\n", num1, num2); } else { printf("%d is equal to %d\n", num1, num2); } return 0; } Explanation: The program takes two integers as input from the user. It uses if, else if, and else statements to compare the two numbers. Depending on the condition: […] - [Write a program to check whether a given year is leap year or not](https://topicnest.in/write-a-program-to-check-whether-a-given-year-is-leap-year-or-not/): #include <stdio.h> int main() { int year; // Input year from user printf("Enter a year: "); scanf("%d", &year); // Leap year logic if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) { printf("%d is a leap year.\n", year); } else { printf("%d is not a leap year.\n", year); } return 0; } Explanation: A year is considered a leap year if: It is divisible by 4 and not divisible by 100OR It is divisible by 400 This logic ensures: Years like 2000, 2016, and 2024 are leap years Years like 1900, […] - [Write a program to check whether the given no is even or odd](https://topicnest.in/write-a-program-to-check-whether-the-given-no-is-even-or-odd/): #include <stdio.h> int main() { int number; // Input number from user printf("Enter a number: "); scanf("%d", &number); // Check if the number is even or odd if (number % 2 == 0) { printf("%d is an even number.\n", number); } else { printf("%d is an odd number.\n", number); } return 0; }   Explanation: An even number is divisible by 2 (remainder is 0). An odd number gives a remainder of 1 when divided by 2. The program uses the modulus operator % to check the remainder: If number % 2 == 0, it’s even. Else, it’s odd. Example: […] - [Write a program to perform division of 2 nos](https://topicnest.in/write-a-program-to-perform-division-of-2-nos/): #include int main() { int a,b; float c; printf("Enter 2 nos : "); scanf("%d %d", &a, &b); if(b == 0) { printf("Division is not possible"); } c = a/b; printf("quotient is %f \n",c); return 0; } Enter 2 nos: 6 2 quotient is 3 Output: Enter 2 nos: 6 0 Division is not possible - [Write a program to print a message if negative no is entered](https://topicnest.in/write-a-program-to-print-a-message-if-negative-no-is-entered/): #include int main() { int no; printf("Enter a no : "); scanf("%d", &no); if(no - [Operators Precedence in C](https://topicnest.in/operators-precedence-in-c/): Operator precedence determines the grouping of terms in an expression. This affects how an expression is evaluated. Certain operators have higher precedence than others; for example, the multiplication operator has higher precedence than the addition operator. For example, x = 7 + 3 * 2; here, x is assigned 13, not 20 because operator * has higher precedence than +, so it first gets multiplied with 3*2 and then adds into 7. Here, operators with the highest precedence appear at the top of the table, and those with the lowest appear at the bottom. Within an expression, higher precedence operators […] - [Operators in C](https://topicnest.in/operators-in-c/): An operator is a symbol that tells the compiler to perform specific mathematical or logical manipulations. C language is rich in built-in operators and provides the following types of operators: Arithmetic Operators Relational Operators Logical Operators Bitwise Operators Assignment Operators Increment and decrement operators Conditional operators Misc Operators Arithmetic operator: These are used to perform mathematical calculations like addition, subtraction, multiplication, division and modulus. The following table shows all the arithmetic operators supported by C language. Assume variable A holds 10 and variable B holds 20 then: Operator Description Example + Adds two operands A + B will give 30 […] - [Programming Language Translators](https://topicnest.in/programming-language-translators/): As you know that high-level language is machine-independent and assembly language though it is machine-dependent yet mnemonics that are being used to represent instructions are not directly understandable by the machine. Hence to make the machine understand the instructions provided by both languages, programming language instructors are used. They transform the instruction prepared by programmers into a form that can be interpreted & executed by the computer. Flowing are the various tools to achieve this purpose: Compiler: The software that reads a program written in high level language and translates it into an equivalent program in machine language is called […] - [Explain Programming language](https://topicnest.in/explain-programming-language/): A language that is acceptable to a computer system is called a computer language or programming language and the process of creating a sequence of instructions in such a language is called programming or coding. A program is a set of instructions, written to perform a specific task by the computer. A set of large program is called software. To develop software, one must have knowledge of a programming language. Before moving on to any programming language, it is important to know about the various types of languages used by the computer. Let us first know what the basic requirements […] ## Pages - [Checkout](https://topicnest.in/checkout/) - [Blog](https://topicnest.in/blog/) - [Home](https://topicnest.in/): Study Abroad Study in the UK: Your Complete Guide to Courses, Scholarships, and Opportunities 0 Comments 4 Views Food Health Preventive Care Top Immunity-Boosting Foods to Eat During the Rainy Season 0 Comments Food Natural Remedies Immunity booster drinks for rainy season 0 Comments C and C++ Computer Graphics program for man object moving OS Computer-system operation Computer Graphics Difference between Raster scan system and Random scan system C and C++ Computer Graphics program for simple animation of football goal C and C++ Computer Graphics Graphics program for man walking C and C++ Computer Graphics program for windmill rotation Trending […] ## Products - [INSTA360 One X2 Pocket Steady](https://topicnest.in/product/insta360-one-x2-pocket-steady-camera/): This is an external product. - [Airpods Pro With MagSafe Charging](https://topicnest.in/product/airpods-pro-with-magsafe-charging-case/): This is a grouped product. - [MacBook Pro 13inch (2022) | M2 Chip](https://topicnest.in/product/macbook-pro-13inch-2022-m2-chip/): This is a simple product. - [MacBook Air (2022) | M2 Chip | 8GB](https://topicnest.in/product/macbook-air-2022-m2-chip-8gb/): This is a simple product. - [iPhone 13 Pro Max 256GB](https://topicnest.in/product/iphone-13-pro-max-256gb/): This is a simple, virtual product. - [MacBook Pro 14inch (2021) | M1Pro](https://topicnest.in/product/macbook-pro-14inch-2021-m1pro/): This is a simple, virtual product. - [Basic Colored Sweatpants With Elastic](https://topicnest.in/product/basic-colored-sweatpants-with-elastic/): This is a simple product. - [World Wide Cup Print T-Shirt](https://topicnest.in/product/world-wide-cup-print-t-shirt/): This is a simple product. - [Check Overshirt With Pocket Detail](https://topicnest.in/product/check-overshirt-with-pocket-detail/): This is a simple product. - [Short Sleeve T-Shirt With Landscape Graphic](https://topicnest.in/product/short-sleeve-t-shirt-with-landscape-graphic/): This is a simple product. - [Sleeveless Ribbed Short Dress](https://topicnest.in/product/sleeveless-ribbed-short-dress/): This is a simple product. - [Pouch Pocket Hoodie Orange](https://topicnest.in/product/pouch-pocket-hoodie-orange/): This is a simple product. - [Short Nylon-Effect Puffer Jacket](https://topicnest.in/product/short-nylon-effect-puffer-jacket/): This is a simple product. - [Short Dress With Knotted Skirt](https://topicnest.in/product/short-dress-with-knotted-skirt/): This is a simple product. - [Ripped Mom Jeans – Contains Recycled](https://topicnest.in/product/ripped-mom-jeans-contains-recycled-cotton/): This is a simple product. - [Ripped Wide-Leg ’90s Jeans](https://topicnest.in/product/ripped-wide-leg-90s-jeans/): This is a simple product. - [Ripstop Cargo Trousers With Pockets](https://topicnest.in/product/ripstop-cargo-trousers-with-pockets/): This is a variable product. - [Galaxy Z Fold3 5G new Model 2022](https://topicnest.in/product/galaxy-z-fold3-5g-new-model-2022/): This is a variable product. [comment]: # (Generated by Hostinger Tools Plugin)