Paint program in c language

painting program in language

Paint program in c language   This program can draw different shapes using mouse such as line, circle, pixel and many other shapes. You can also change the color, clear the screen. #include<graphics.h> #include<dos.h> #include<math.h> #include<stdlib.h> #include<stdio.h> #include<conio.h> union REGS i, o; int leftcolor[15]; int get_key() { union REGS i,o; i.h.ah = 0; int86(22, &i, … Read more

Drawing concentric circles – C graphics examples

c graphics program example

Drawing concentric circles – C graphics examples   #include <graphics.h> int main() { int gd = DETECT, gm; int x = 320, y = 240, radius; initgraph(&gd, &gm, “C:\\TC\\BGI”); for ( radius = 25; radius <= 125 ; radius = radius + 20) circle(x, y, radius); getch(); closegraph(); return 0; }    

C graphics programming

basic graphics program in c

C graphics programming     #include <graphics.h>   #include <conio.h>    int main()   {       int gd = DETECT, gm;      initgraph(&gd, &gm,”C:\\TC\\BGI”);      outtextxy(10, 20, “Graphics programming is fun!”);      circle(200, 200, 50);       setcolor(BLUE);       line(350, 250, 450, 50);       getch();       closegraph( );       return 0;   }

comment in c program

comment in c program

comment in c program   Example – comments in a program #include <stdio.h>   int main()   {      // Single line comment in a C program      printf(“Writing comments is very useful.\n”);      /*       * Multi-line comment syntax       * Comments help us to understand program later … Read more

How to disable IPv6 in Ubuntu

ubuntu

 How to disable IPv6 in Ubuntu To disable ipv6, you have to open /etc/sysctl.conf using any text editor and insert the following lines at the end: net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.lo.disable_ipv6 = 1 If ipv6 is still not disabled, then the problem is that sysctl.conf is still not activated. To solve this, open a terminal(Ctrl+Alt+T) and type … 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

MySQL Server Logs

mysql 5.7

 MySQL Server Logs MySQL Server has several logs that can help you find out what activity is taking place. By default, no logs are enabled, except the error log on Windows. (The DDL log is always created when required, and has no user-configurable options. The following logspecific sections provide information about the server options that … 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