
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
bar() function in C graphics
bar() function is a C graphics function that is used to draw graphics in the C programming language. The graphics.h header contains functions that work for drawing graphics. The bar() function is also defined in the header file.
Syntax
void bar(int left, int top, int right, int bottom );
The bar() function is used to draw a bar ( of bar graph) which is a 2-dimensional figure. It is filled rectangular figure. The function takes four arguments that are the coordinates of (X, Y) coordinates of the top-left corner of the bar {left and top } and (X, Y) coordinates of the bottom-right corner of the bar {right and bottom}.
PROGRAM
#include <graphics.h> #include <conio.h> int main() { int gd = DETECT, gm; initgraph(&gd, &gm, "C:\TC\BGI"); bar(120, 120, 250, 250); getch(); closegraph(); return 0; }
Output
- Related Articles
- Draw a line in C++ graphics
- Point Clipping Algorithm in Computer Graphics in C++
- Flood fill algorithm using C graphics
- Turtle graphics using Python
- How to make graphics with a script in HTML?
- How to connect a progress bar to a function in Tkinter?
- How to create SVG graphics using JavaScript?
- Difference between Graphics Card and Video Card
- Types of graphics are supported by HTML5?
- How to work with Scalable Vector Graphics (SVG) in HTML5?
- How to create varying width bar chart using barplot function in R?
- How to create a horizontal bar plot using barplot function in R?
- How to add Track-bar in OpenCV using C++?
- How to use splash vector graphics on your Responsive Site?
- What is the best desktop configuration for a graphics designer?

Advertisements