C program to draw a 3D bar chart

3d bar chart program in c

C program to draw a 3D bar chart #include <graphics.h> #include <conio.h> int main() { int gd = DETECT, gm; initgraph(&gd, &gm, “C:\\TC\\BGI”); setcolor(YELLOW); rectangle(0,30,639,450); settextstyle(SANS_SERIF_FONT,HORIZ_DIR,2); setcolor(WHITE); outtextxy(275,0,”Bar Chart”); setlinestyle(SOLID_LINE,0,2); line(100,420,100,60); line(100,420,600,420); line(90,70,100,60); line(110,70,100,60); line(590,410,600,420); line(590,430,600,420); outtextxy(95,35,”Y”); outtextxy(610,405,”X”); outtextxy(85,415,”O”); setfillstyle(LINE_FILL,BLUE); bar(150,100,200,419); setfillstyle(XHATCH_FILL,RED); bar(225,150,275,419); setfillstyle(WIDE_DOT_FILL,GREEN); bar(300,200,350,419); setfillstyle(INTERLEAVE_FILL,MAGENTA); bar(375,125,425,419); setfillstyle(HATCH_FILL,BROWN); bar(450,175,500,419); getch(); return 0; }  

PWD – Linux command to check current working directory

PWD – Linux command to check current working directory   When you first open the terminal, you are in the home directory of your user. To know which directory you are in, you can use the “pwd” command. It gives us the absolute path, which means the path that starts from the root. The root is the … Read more

Bar chart program in c

bar chart program in c

Bar chart program in c Chart is drawn using bars filled with different styles and in different colors. #include <graphics.h> #include <conio.h> main() { int gd = DETECT, gm; initgraph(&gd, &gm, “C:\\TC\\BGI”); setcolor(YELLOW); rectangle(0,30,639,450); settextstyle(SANS_SERIF_FONT,HORIZ_DIR,2); setcolor(WHITE); outtextxy(275,0,”Bar Chart”); setlinestyle(SOLID_LINE,0,2); line(100,420,100,60); line(100,420,600,420); line(90,70,100,60); line(110,70,100,60); line(590,410,600,420); line(590,430,600,420); outtextxy(95,35,”Y”); outtextxy(610,405,”X”); outtextxy(85,415,”O”); setfillstyle(LINE_FILL,BLUE); bar(150,100,200,419); setfillstyle(XHATCH_FILL,RED); bar(225,150,275,419); setfillstyle(WIDE_DOT_FILL,GREEN); bar(300,200,350,419); setfillstyle(INTERLEAVE_FILL,MAGENTA); … Read more

C Program to Check Whether a Character is Vowel or Consonant

c program for vowel and consonent

C Program to Check Whether a Character is Vowel or Consonant The five alphabets A, E, I, O and U are called vowels. All other alphabets except these 5 vowel letters are called consonants.   #include <stdio.h> int main() { char c; int isLowercaseVowel, isUppercaseVowel; printf(“Enter an alphabet: “); scanf(“%c”,&c); // evaluates to 1 (true) … Read more

C Program to Find Factorial of a Number

factorial program example in c

C Program to Find Factorial of a Number The factorial of a positive number n is given by: factorial of n (n!) = 1*2*3*4….n The factorial of a negative number doesn’t exist. And, the factorial of 0 is 1, 0! = 1 #include <stdio.h> int main() { int n, i; unsigned long long factorial = 1; … Read more

Creating and Selecting a Database

creating and selecting a database in mysql on cli

Creating and Selecting a Database If the database administrator creates your database for you when setting up your permissions, you can begin using it. Otherwise, you need to create it yourself: mysql> CREATE DATABASE test2; Under Unix, database names are case-sensitive (unlike SQL keywords), so you must always refer to your database as test2, not … Read more

C Program to wish happy new year

wish happy new year

C Program to wish happy new year #include<stdio.h> #include<conio.h> #include<graphics.h> void shoot(); void shootagain(); void area(); void explode(int,int,int); void main() { int gm,gd=DETECT; initgraph(&gd,&gm,”C:\\TURBOC3\\BGI”); shoot(); getch(); closegraph(); } void shoot() { int i=0; int x=0,y=480,x1=15,y1=460; while(i<350) { area(); line(x+i,y-i,x1+i,y1-i); delay(50); i=i+10; cleardevice(); } explode(x+350,y-350,5); shootagain(); } void shootagain() { int i=0; int x=600,y=480,x1=585,y1=460; while(i<250) { … Read more

Filter Logs with Grep : linux Command Grep

grep linux command

Filter Logs with Grep : linux Command Grep Let’s understand the use of grep is to extract useful information from system logs: grep -Eoc “^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}.* 200” /srv/www/example.com/logs/access.log   In this command, grep filters an Apache access log for all lines that begin with an IP address, followed by a number of characters, a space and then the … Read more

SQL CASE

mysql 5.7

SQL CASE The CASE statement goes through conditions and return a value when the first condition is met (like an IF-THEN-ELSE statement). So, once a condition is true, it will stop reading and return the result. If no conditions are true, it returns the value in the ELSE clause. If there is no ELSE part … Read more