Reading String with spaces by using scanf

Reading String with spaces by using scanf Note that - scanf with %s accepts only String which does not contain whitespaces (blanks/space) C Supports the ‘ special Edit set Conversion Code ‘ , by using this method we can accept the line of String with spaces using scanf It Reads wide verity of Characters including(…)

Arithmetic Operations On Character in C Programming

Arithmetic Operations On Character : C Programming Allows you to Manipulate on String Whenever the Character is variable is used in the expression then it is automatically Converted into Integer Value called ASCII value All Characters can be Manipulated with that Integer Value.(Addition,Subtraction) Examples : ASCII value of : ‘a’ is 97 ASCII value of(…)

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

> 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

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

> ctype.h >> Functions in C Programming Language">

Header File : Ctype.h : Functions in C Programming Language _ftolower _ftoupper isalnum isalpha isascii iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit toascii tolower toupper

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

> 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

> 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

> 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

> 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 From User in C Reads String Character by Character Syntax for Accepting String : ch = getchar(); // getchar accepts character & stores in ch Example : ch = getchar() ; name[0] = getchar(); Live Example : : For Accepting String (Use One of the Loop) #include<stdio.h> void main()(…)