Drawing Circle in Graphics Mode : Circle Function >> Graphics.h

Program : #include<graphics.h> #include<stdio.h> int main(void) { int gdriver = DETECT,gmode; int x=200, y=200; int rad=50; initgraph(&gdriver, &gmode, “c:\\tc\\bgi”); circle(x,y,rad); closegraph(); } Explanation : circle(x,y,rad); Circle Function Draws Circle having Center (x,y) and Radius ‘rad’ Syntax : circle(x,y,rad); Parameter Explanation x X Co-ordinate of Center y Y Co-ordinate of Center rad Length of Radius

Common Errors in C : Part 1

Common Errors in C :. Pre Processor Directives Error / Mistake 1 : Semicolon at the end of #define Example : #define MAX 100; Error / Mistake 2 : Typing Incorrect Spelling of the ‘include’ / Header file Example : stdio.h includ

Header File >> Conio.h >> Functions in C Programming Language

Header File >> Conio.h >> Functions in C Programming Language cgets clreol clrscr cprintf cputs cscanf delline getch getche getpass gettext gettextinfo gotoxy highvideo insline inp inport inportb inpw kbhit lowvideo movetext normvideo outp outport outportb outpw putch puttext _setcursortype textattr textbackground textcolor textmode ungetch wherex wherey window

Putchar function >> Displaying String in C

Putchar function : Displaying String in C Programming Syntax : int putchar(int c); Way 1 : Taking Character as Parameter putchar(‘a’) ; // Displays : a Individual Character is Given as parameter to this function. We have to explicitly mention Character. Way 2 : Taking Variable as Parameter putchar(a); // Display Character Stored in a(…)

Puts >> Displaying String in C Programming

Puts >> Displaying String in C Programming : Way 1 :Messaging puts(” Type your Message / Instruction “); Like Printf Statement puts() can be used to display message. Way 2 : Display String puts(string_Variable_name) ; Notes or Facts : puts is included in header file “stdio.h” As name suggest it used for Printing or Displaying(…)

Printf >> Displaying String in C Programming

Printf >> Displaying String in C Programming : Syntax : Way 1 : Messaging printf (” Type your Message / Instruction ” ) ; Way 2 : Display String printf (“Name of Person is %s “, name ) ; Notes or Facts : printf is included in header file “stdio.h” As name suggest it used(…)

Getchar : Reading or Accepting String Character by Character

getchar() : Reading or Accepting String Character by Character In C Programming we have many input/output functions that are useful for accepting input from the user. i.e scanf() | gets(). Getchar() function is also one of the function which is used to accept the single character from the user. Syntax for Accepting String and Working(…)

gets() function : Accepting String from User in C Programming

gets() function : Reading or Accepting String From User in C Reads characters from the standard input (stdin) and stores them as a C string into str until a newline character or the end-of-file is reached. Syntax for Accepting String : char * gets ( char * str ); OR gets( <variable-name> ) Live Example(…)

Initializing String / Charater Array in C Programming

In the previous chapter we have learnt about declaring array of character i.e String. In this chapter we are looking one step forward - Initializing the String and Different ways of Initializing String. Initializing String [Character Array] : Whenever we declare a String then it will contain garbage values inside it. We have to initialize(…)