The Best IDE For C Programming

There are many IDE(Integrated Development Environment) available for C programming language, but I would prefer using Code::Blocks or Visual Studio Editor.

For this video tutorial series we’ll be using Code::Blocks.

You can visit CodeBlocks website and navigate to Downloads section, and then to Binaries section and depending upon your Operating System, download the IDE and install it. Downloading and installation of Code::Blocks is shown in the video posted below. You can follow along and get started with programming in C language.

 
#include < stdio.h >
int main()
{
    printf("Microsoft\n Apple\n Oracle\n Google\n Yahoo\n");
    return 0;
}

Output:
Microsoft
Apple
Oracle
Google
Yahoo

Above program is just an example. You need not worry if you didn’t understand it. I’ll be explaining it in the next video, in detail. For now, if possible type the program as it is and try to compile and execute it on your own by seeing the video. Try to change the content inside printf function and run compilation(Build) and execution(Run) once again and see the results for yourself.

The Best IDE For C Programming


[youtube https://www.youtube.com/watch?v=xsWy-sMzIj0]

YouTube Link: https://www.youtube.com/watch?v=xsWy-sMzIj0 [Watch the Video In Full Screen.]


Note:
1. Code::Blocks is available for all the popular Operating Systems. So whatever I show in the video tutorial is applicable for everyone irrespective of the OS they’re using.

2. Code::Blocks comes with C/C++ compiler, so you need not install compiler or any other plugins separately.

3. Make sure to download the latest version of the IDE. And make sure the file you download has ( codeblocks-17.12mingw-setup ) mingw in it. That’s how we can know it comes shipped with c/c++ compiler by default.

Why Learn ‘C’ As Your First Programming Language?

Let’s know a little bit of history of C programming. Many of you may not be interested in knowing the history of C – you maybe here just to learn how to get started with Coding in C Program. I understand that. You’ll want to know the history soon, once you learn the basics of C programming. History is very important. But for now I’ll let you know about it in 1 line!

History of C Programming Language

C Programming language was developed at AT&T’s Bell Lab in 1972. It was designed and developed by a man called Dennis Ritchie (September 9, 1941 – October 12, 2011).

Why name it as C?
Before designing C, there was a programming language called “B”. So Dennis Ritchie named it as “C”. Little did he know “C Programming” language would get so popular among programmers – even after 3 decades of its inception.


C programming language

Why Learn C As A First Programming Language?

Beginners tend to get into arguments/discussion as to how C++, C#, Java has improved upon C and how “Object Oriented Programming” has so many advantages over C. But let me tell you, Operating Systems like Windows, iOS, OSx, Unix/Linux(Kernel), android are all written in C. Looks like there is something which is good in C because of which companies like Microsoft, Apple, Unix/Linux Foundation, Google are choosing C Programming language to develop and maintain their Operating Systems. These are only a few popular companies I’ve listed. There are many many companies solely dependent upon C programming for their software development. We’ll learn more along the course of these video tutorials.

Why Learn C As A First Programming Language?


[youtube https://www.youtube.com/watch?v=s88KJDI1P_o]

YouTube Link: https://www.youtube.com/watch?v=s88KJDI1P_o [Watch the Video In Full Screen.]


Advantages of learning C

1. Object Oriented Programming(OOP) method present in C++, C#, Java provides a huge advantage for programmers. But the basic programming elements like looping, variables, declaration, arithmetic operations, logical operations etc are almost similar to what you learn in C. Learning C definitely gives you an extra edge before jumping on to learn C++ or C# or Java.

2. Programs written in C are very efficient. It’s performance and speed of execution is unique. Even today device drivers are written in C for this reason. The code is compact and has high performance even in low memory availability.

3. Your smartphone, digital camera, washing machine, microwave oven, refrigerator, smart bulbs, smart fans etc you name it, all these have microprocessors attached to it, which has program embedded in it. Since these micro-processor in these devices have limited memory and need to respond to user inputs instantly, the program of choice is inevitably C, in most cases.

4. Most 3D gaming frameworks like “DirectX” are built using the C Programming language. Because for good gaming experience speed of execution matters a lot. Since C programs are robust, reliable and fast these 3D gaming framework choose C programming over others. Even animation special effects in movies are done using C programs.

5. Its flexible and portable: Since C program allows user to handle memory directly we can write programs very flexibly according to our needs. We can manage memory flexibly. “Portable” because the same program source code works on all operating systems without the need for much modification. All Operating System have C Compiler and they compile and give object code and executable which suits and works for that particular OS.

6. Did you know, many compilers and interpreters for other languages like FORTRAN, Pascal, Perl, Python etc are written in C. Why is it so? As I told you before, C is reliable, portable and fast.

7. Using C programming language we can directly access hardware. This is very powerful feature. We’ll discuss this in detail in coming video tutorials.

8. C program enables programmer to manipulate individual bits of memory. But “with power comes responsibility” – we need to handle memory carefully or else we may end up writing code which might behave abruptly. For this reason Java has its own builtin memory management feature called Garbage Collection.

9. C implementation has a large library of useful functions. Ex: scanf, printf, functions to write data to file etc.

10. C programming language is easy to learn and understand.

We can go on and keep writing advantages of learning C Program. But let me stop here and assure you that you’re in the right place and C is the best choice as your first programming language to learn.

Make sure to practice all the programs we post here and quickly you’ll know the advantage for yourself. And soon you’ll be an advanced user and if you keep learning you’ll be an expert.

There are many Job opportunities for people who are experts in C Programming Language. We’ll even post Job Board shortly and try to list job offers for C program experts. Stay tuned for all the good stuff we’ll post on this page: C Programming: Beginner To Advance To Expert

Request

Please let us know some advantages and disadvantages or anything informative about C programming language in the comment section below. This will be helpful for others joining you on later date to start learning ‘C Programming language’. Sharing is caring. Also please share this article with your friends and followers on Social Media.

C Programming: Beginner To Advance To Expert

C is a general-purpose, procedural computer programming language. C reduces the gap between high level language and low level language. Hence C is known as Middle Level Language. You can know more about C in brief in our first video tutorial posted below.



“The best way to learn a new programming language is by writing programs in it.” – Dennis Ritche

Follow the order in which it is post below and make sure to practice all the tutorials. Even simple programs need to be written and executed by you, so that it gets into your subconscious memory :)

If you got to learn anything from our website, then please do not forget to share this page with your friends on Facebook, LinkedIn, Twitter etc..

This list also includes tutorials for your college exams, viva and campus interview questions. We have gone through and regularly keep ourselves updated with interview questions of TCS, Infosys, Wipro, Tech Mahindra, HCL, olta, Cyient, Oracle Financial Services, Mphasis, Mindtree, Microsoft, IBM, Google, Apple etc.

Please support us by sharing this page with your friends on social media sites. Also stay subscribed to our blog and YouTube channel.

Enter your email address:

C programming Language, Free Video Tutorials List

[youtube https://www.youtube.com/embed/videoseries?list=PLM4pPs1mzl_OgHW0_jfgDz3ZR_gUbp-47]

  1. Why Learn ‘C’ As Your First Programming Language?
  2. The Best IDE For C Programming
  3. Structure of a basic C Program
  4. include directive in C Program
  5. Keywords, Constants, Variables: C
  6. Using Scanf in C Program
  7. Rules for Constructing int, float, char constants: C
  8. Rules for Constructing Variable Names: C
  9. Basic Arithmetic Operations In C
  10. Swap 2 Numbers Using a Temporary Variable: C
  11. Swap 2 Numbers Without Using a Temporary Variable: C
  12. Swap 2 numbers using Addition and Subtraction: C
  13. Swap 2 numbers using Multiplication and Division: C
  14. Calculate Area of a Circle without using math.h library: C
  15. Calculate Area of a Circle using math.h library: C
  16. C Program to Calculate the Simple Interest
  17. C Program to Calculate the Compound Interest
  18. Addition of 2 Numbers: C
  19. Subtraction of 2 Numbers: C
  20. Multiplication of 2 Numbers: C
  21. Relational Operators In C
  22. Decision Control Instruction In C: IF
  23. Division of 2 Numbers: C
  24. if else statement in C
  25. Nested if else Statement In C
  26. else if statement in C
  27. Simple Calculator Application In C
  28. Roots of Quadratic Equation: C
  29. C Program To Check Leap Year
  30. Simple Calculator Program using Switch Case: C
  31. C Program to Calculate Gross Salary of an Employee
  32. Logical Operators In C
  33. Even or Odd Number: C Program
  34. Even or Odd Number without using Modular Division: C Program
  35. Discount on Purchase: C Program
  36. Employee Bonus Calculation: C
  37. Assignment Operators in C
  38. Biggest of Two Numbers : C
  39. Ternary Operator / Conditional Operator In C
  40. Biggest of Two Numbers Using Ternary Operator: C
  41. Biggest of 3 Numbers: C
  42. Biggest of 3 Numbers Using Ternary Operator: C
  43. while loop in C programming
  44. Even or Odd Number using Ternary Operator: C Program
  45. Even or Odd Number using Ternary Operator and without using Modular Division: C Program
  46. Fibonacci Series using While loop: C Program
  47. Post-increment and Pre-increment Operator: C Program
  48. Post-decrement and Pre-decrement Operator: C Program
  49. Operator Precedence / Priority: C
  50. Number is Positive or Negative or Zero: C Program
  51. Positive or Negative or Zero Using Ternary Operator: C Program
  52. C Program To Check Leap Year Using Ternary Operator
  53. DA, HRA, Gross Salary: C Program
  54. Convert Degree Celsius To Fahrenheit: C Program
  55. Convert Fahrenheit To Degree Celsius: C Program
  56. Area of Rectangle: C Program
  57. Perimeter of Rectangle: C Program
  58. Convert Kilometer To Meter, Centimeter, Millimeter: C Program
  59. Calculate Sum of Digits: C Program
  60. C Program To Reverse a Number
  61. Check whether a Number is Palindrome or Not: C Program
  62. C Program to Check Armstrong Number
  63. Nested While Loop: C Program
  64. C Program to print Armstrong Numbers between 1 and 500
  65. Calculate Power of a Number: C Program
  66. Calculate Power of a Number using pow(): C Program
  67. C Program to print Armstrong Numbers Between Two Integers
  68. Find Area of a Triangle Using Its Sides: C Program
  69. Triangle Valid or Not based On Sides: C Program
  70. C Program To Find Area, Perimeter and Semi-perimeter: Valid Triangle
  71. C Program To Check whether a Triangle is Equilateral, Isosceles or Scalene
  72. Find Area of an Equilateral Triangle: C Program
  73. Triangle Valid or Not based On Angles: C Program
  74. Find Missing Angle in a Triangle if two angles are given: C Program
  75. Find Area of a Triangle Using Its Base and Height: C Program
  76. C Program to Generate Even Numbers Between Two Integers
  77. C Program to Generate Odd Numbers Between Two Integers
  78. Print All Trigonometric Ratios: C Program
  79. C Program To Convert Cartesian To Polar Co-ordinates
  80. C Program To Convert Polar To Cartesian Co-ordinates
  81. Calculate Distance in Nautical Miles: C Program
  82. C Program To Compute Smallest Number of Notes That Will Combine To Give Rs N
  83. C Program To Print Multiplication Table Using While Loop
  84. Calculate Sum and Average of N Numbers without using Arrays: C Program
  85. Find Biggest of N Numbers, without using Arrays: C Program
  86. Find First and Second Biggest in N Numbers, without using Arrays: C Program
  87. C Program to Find Factors of a Number
  88. C Program To Find Factorial of a Number
  89. C Program to Find First and Last Digit of a Number
  90. C Program to Find Generic Root of a Number
  91. C Program to Calculate Generic Root of a Number using Ternary Operator
  92. C Program to Calculate Generic Root of a Number using Mathematical Formula
  93. C Program to Find GCD or HCF of Two Numbers
  94. C Program to Find LCM of Two Numbers
  95. C Program To Find GCD and LCM of Two Numbers
  96. C Program To Find GCD and LCM of Two Numbers using Euclidean algorithm
  97. C Program to Print Natural Numbers from 1 to N using While loop
  98. C Program to Print Natural Numbers from 1 to N In Reverse Order using While loop
  99. C Program to Print Natural Numbers Between Two Numbers using While loop
  100. C Program to Calculate the Sum of Natural Numbers Between Range
  101. C Program to Calculate the Sum of Natural Numbers From 1 to N
  102. C Program to Find Surface Area and Volume of a Cube
  103. C program To Find Area of Right Angled Triangle
  104. C Program to Find Perfect Number using while loop
  105. C program To Check whether a Number is Strong Number or Not
  106. C Program To Print Floyd’s Triangle
  107. C Program To Print Floyd’s Triangle In Reverse
  108. C Program To Subtract Two Numbers without using Minus Operator
  109. C Program To Add Two Numbers without using Plus Operator
  110. C Program to Print ASCII Value of a Character
  111. C Program To Print All ASCII Characters and Code
  112. C Program To Check Whether a Character is an Alphabet or Not
  113. C Program To Print Uppercase Alphabet(A-Z) using While loop
  114. C Program To Print Lowercase Alphabet(a-z) using While loop
  115. C Program To Check Whether a Character is Vowel or Consonant
  116. C Program To Find Prime Number or Not using While Loop
  117. C Program To Find Prime Numbers From 2 To N, using While Loop
  118. C Program To Find Prime Numbers Between Two Intervals, using While Loop
  119. C Program To Find Sum of All Odd Numbers From 1 To N, using While loop
  120. C Program To Find Sum of All Even Numbers From 1 To N, using While loop
  121. C Program To Find Sum of All Even Numbers Between Two Integers, using While loop
  122. C Program To Find Sum of All Odd Numbers Between Two Integers, using While loop
  123. C Program To Print 1+4+9+16 Series, using While Loop
  124. C Program To Display Right Angled Triangle With Alphabets, using While Loop
  125. C Program To Convert Decimal Number To Binary Number, using While Loop
  126. C Program To Convert Binary Number To Decimal Number, using While Loop
  127. C Program To Convert Decimal Number To Octal Number, using While Loop
  128. C Program To Convert Octal Number To Decimal Number, using While Loop
  129. C Program To Convert Decimal To Octal Number In One Line
  130. C Program To Convert Octal To Decimal Number In One Line
  131. C Program To Convert Binary Number To Octal Number, using While Loop
  132. C Program To Convert Octal Number To Binary Number, using While Loop
  133. C Program To Find Biggest of 3 Numbers using Binary Minus Operator
  134. Sizeof Operator in C Programming Language
  135. C Program To Find Sum of Squares of Numbers from 1 to N, using While Loop
  136. C Program To Draw Pyramid of Stars, using While Loop
  137. C Program To Calculate Area of a Square using its Side
  138. C Program To Calculate Area of a Square using its Diagonal
  139. C Program To Calculate Perimeter, Diagonal of a Square using its Side
  140. C Program To Calculate Area of Rhombus
  141. C Program To Draw Pyramid of Alphabets, using While Loop
  142. C Program To Draw Pyramid of Numbers, using While Loop
  143. C Program To Find The Day on 01 January using Gregorian Calendar
  144. C Program To Find Absolute Value of a Number
  145. C Program To Count Positive, Negative and Zero without using Array
  146. C Program To Count Positive, Negative and Zero using Ternary Operator and without using Array
  147. C Program To Calculate Profit or Loss
  148. C Program To Determine Youngest of Three
  149. C Program To Find Whether Area of Rectangle Is Greater Than Its Perimeter
  150. C Program To Check If Three Points Are On One Straight Line
  151. C Program To Check If Point Lies Inside, Outside or On The Circle
  152. C Program To Check If Point Lies on x-axis or y-axis or Origin
  153. C Program To Check In Which Quadrant The Point Lies
  154. C Program To Check For Alphabet, Number and Special Symbol
  155. C Program To Find Grade of Steel
  156. C Program To Determine Weight Class of a Boxer
  157. C Program To Determine Leap Year or Not using Logical Operators
  158. C Program To Convert (R, G, B) To (C, M, Y, K) Color Format
  159. C Program To Display Zodiac Sign for Given Date of Birth
  160. C Program To Calculate BMI and BMI Category
  161. C Program To Find Lowercase Alphabet or Not using Conditional Operator
  162. C Program To Find Special Symbol or Not using Conditional Operator
  163. C Program To Check If Sum of Square of Sine and Cosine of an Angle is 1
  164. C Program To Determine Designation of Employee Based On Salary
  165. C Program To Calculate Overtime Pay of 10 Employees
  166. C Program To Find Range of Set of Numbers
  167. 21 Matchstick Game: C Program
  168. Modulus or Modulo Division In C Programming Language
  169. C Program To Calculate Volume of Cylinder
  170. C Program To Calculate Circumference of Circle
  171. C Program To Calculate Surface Area of Cylinder
  172. C Program To Calculate Volume of Sphere
  173. C Program To Calculate Surface Area of Sphere
  174. C Program To Calculate Volume of Cone
  175. C Program To Calculate Surface Area of Cone
  176. C Program To Calculate Distance Between Two Points
  177. C Program To Calculate Percentage Difference Between 2 Numbers
  178. C Program To Convert Kilograms to Pounds
  179. C Program To Convert Pounds to Kilograms
  180. C Program To Convert Degree To Radian
  181. C Program To Convert Radian To Degree
  182. For Loop In C Programming Language
  183. C Program to Print Natural Numbers from 1 to N using for loop
  184. C Program to Print Natural Numbers from 1 to N In Reverse Order using for loop
  185. C Program To Print Natural Numbers Between Two Numbers using for loop
  186. C Program To Calculate the Sum of Natural Numbers From 1 to N using For Loop
  187. C Program To Calculate Sum of Natural Numbers Between Range using For Loop
  188. Nested For Loop In C Programming Language
  189. C Program To Print Matrix using Nested For Loop
  190. Continue Statement In C Programming Language
  191. break Statement In C Programming Language
  192. C Program To Find Prime Number or Not using For Loop
  193. C Program To Find Prime Numbers From 1 To 300 using For Loop
  194. C Program To Find Prime Numbers From 2 To N, using For Loop
  195. C Program To Find Prime Numbers Between Range, using For Loop
  196. C Program To Fill Screen With Smiling Face
  197. C Program To Find Factorial of a Number using For Loop
  198. C Program To Find Sum of Series 1/1! + 2/2! + 3/3! + …. + n/n!
  199. C Program To Generate All Combinations of 1, 2 and 3
  200. C Program To Print Multiplication Table Using For Loop
  201. C Program To Generate Fibonacci Series using For Loop
  202. C Program To Calculate Approximate Level of Intelligence of a Person
  203. C Program To Find Even Numbers Between Range using For Loop
  204. C Program To Find Odd Numbers Between Range using For Loop
  205. C Program To Calculate Amount In Compound Interest
  206. C Program To Find Sum of All Even Numbers From 1 To N, using For loop
  207. C Program To Find Sum of All Odd Numbers From 1 To N, using For loop
  208. C Program To Find Sum of All Even Numbers Between Range, using For loop
  209. C Program To Find Sum of All Odd Numbers Between Range, using For loop
  210. C Program To Calculate Sum and Average of N Numbers without using Arrays, using For Loop
  211. C Program To Find Biggest of N Numbers, without using Arrays, using For Loop
  212. C Program To Find First and Second Biggest in N Numbers, without using Arrays, using For Loop
  213. C Program to Find Factors of a Number using For Loop
  214. C Program to Find Perfect Number using For loop
  215. C Program To Print Floyd’s Triangle using For Loop
  216. C Program To Print All ASCII Characters and Value using For Loop
  217. C Program To Print 1+4+9+16 Series, using For Loop
  218. C Program To Display Right Angled Triangle With Alphabets, using For Loop
  219. C Program To Draw Pyramid of Stars, using For Loop
  220. C Program To Draw Pyramid of Numbers, using For Loop
  221. C Program To Calculate Sum of First 7 Terms of Natural Logarithm
  222. do-while Loop In C Programming Language
  223. goto Keyword In C Programming Language
  224. Switch Case Default In C Programming Language
  225. C Program To Find Grace Marks of Student Using Switch Case
  226. Function / Methods In C Programming Language
  227. Addition of 2 Numbers using Function: C Program
  228. C Program To Check Leap Year or Not using Function
  229. C Program To Find Biggest of Two Numbers using Function
  230. C Program To Find Biggest of Three Numbers using Function
  231. C Program To Find Armstrong Numbers Between 1 and 500 using Function
  232. C Program To Find Armstrong Numbers Between Range using Function
  233. C Program To Generate Fibonacci Series using Function
  234. C Program To Find Factorial of a Number using Function
  235. C Program To Calculate One Number Raised To Another using Function
  236. C Program To Find Prime Factors of a Number
  237. C Program To Express A Number as Sum of Two Prime Numbers
  238. C Program To Find Two Numbers are Co-Prime or Not
  239. C Program To Find If Two Numbers are Co-Prime or Not using Function
  240. C Program To Print N Co-Prime Numbers
  241. C Program To Count Prime Numbers Between Range
  242. C Program To Convert Year To Roman Equivalent
  243. C Program To Print Multiplication Table Using Function
  244. Basics of Pointers In C Programming Language
  245. C Program To Add Two Numbers using Pointers
  246. C Program To Swap Two Numbers using Pointers
  247. C Program To Swap Two Numbers using Function
  248. C Program To Find Area and Circumference of Circle using Pointer
  249. C Program To Find Size of Pointer Variables
  250. Pointer To A Pointer In C Programming Language
  251. Calculate Sum, Average, Variance and Standard Deviation: C Program
  252. C Program To Calculate Average and Percentage of Marks Obtained
  253. C Program To Shift Variable Values Circularly To Right
  254. C Program To Evaluate sin(x) = x – (x^3)/3! + (x^5)/5! + (x^7)/7! + ..
  255. C Program To Calculate Area of a Triangle using Pointers
  256. C Program To Find If a Point Lies Inside Triangle or Not
  257. C Program To Find GCD using Pointers and Functions
  258. C Program To Find GCD using Repeated Subtraction
  259. Recursive Functions In C Programming Language
  260. C Program To Calculate Sum of Digits Using Recursion
  261. Generating Fibonacci Series using Recursion: C Program
  262. C Program To Reverse a Number using Recursion
  263. C Program To Print Natural Numbers using Recursion
  264. C Program To Find Sum of Natural Numbers Using Recursion
  265. C Program To Find Factorial of a Number using Recursion
  266. C Program To Find GCD of Two Numbers using Recursion: Euclid’s Algorithm
  267. C Program To Find Prime Factors of a Number using Recursion
  268. C Program To Convert Decimal To Binary Number using Recursion
  269. C Program To Find Sum of Squares of Digits using Recursion
  270. C Program To Count Digit k in Number n using Recursion
  271. C Program To Count Digit k in Number n
  272. C Program To Find nCr Factorial
  273. C Program To Find nPr Factorial
  274. Preprocessors In C Programming Language
  275. C Program To Find Area of Circle Using Macro Expansion
  276. Macros With Arguments: C Program
  277. Using Macro Template In Macro Expansion: C Program
  278. Macro With Argument v/s Function: C Program
  279. File Inclusion In C Programming Language
  280. Comparing Floating Point Variable With a Value In C Programming
  281. Comments In C Programming Language
  282. Conditional Compilation In C: #ifdef #else #endif
  283. Conditional Compilation In C: #if #elif #else #endif
  284. C Preprocessor Operator: defined
  285. #error Preprocessor Directive: C Programming
  286. Conditional Compilation In C: #ifndef #else #endif
  287. #undef Directive: C Program
  288. #pragma Directive: C Program
  289. Predefined Macros In C Programming Language
  290. Macro Continuation (\) Preprocessor Operator: C Program
  291. Biggest of 3 Numbers using Macros: C Program
  292. Swap 2 Numbers Using Macros: C Program
  293. Determine Leap Year or Not using Macros: C Program
  294. Even or Odd Number using Macros: C Program
  295. Positive or Negative or Zero Using Macros: C Program
  296. C Program To Print Multiplication Table Using Macros
  297. Using Macros Check For Uppercase / Lowercase and Alphabet or Not and Biggest of 2 Numbers: C Program
  298. Using Macros Find Area and Perimeter of Triangle, Square, Circle: C Program
  299. Using Macros Find Arithmetic Mean, Absolute Value, Biggest of 3 number and convert upper case alphabet to lower case: C Program
  300. C Program to Calculate Simple Interest and Amount using Macros
  301. Introduction To Arrays: C Programming Language
  302. Basics of Arrays: C Program
  303. Size of Array using Macro and Constant: C Program
  304. C Program To Print Elements of Array In Reverse Order
  305. Designated Initializers In Array: C Program
  306. C Program To Check Repetition of Digit In A Number using Arrays
  307. C Program To Count Each Digit In A Number using Arrays
  308. Calculate Sum and Average of N Numbers using Arrays: C Program
  309. C Program To Find Biggest Element of An Array
  310. C Program To Find First and Second Biggest Element In An Array
  311. C Program To Find Smallest Element In An Array
  312. C Program To Copy Elements of One Array To Another
  313. C Program To Copy Elements of One Array To Another In Reverse Order
  314. C Program To Find Size of An Array
  315. C Program To Concatenate Two Arrays
  316. C Program To Merge Two Arrays Alternatively
  317. C Program To Count Number of Even, Odd and Zeros In An Array
  318. C Program To Count Number of Positive, Negative and Zeros In An Array
  319. C Program To Split Even and Odd Elements of An Array Into Two Arrays
  320. C Program To Divide/Split An Array Into Two At Specified Position
  321. C Program To Re-arrange Even and Odd Elements of An Array
  322. C Program To Shift Elements of An Array by n Position
  323. C Program To Insert New Element At Specified Position of An Array
  324. C Program To Delete Element of An Array at Specified Position
  325. C program To Count and Display Even and Odd Elements of An Array
  326. C Program To Segregate 0’s and 1’s In An Array using Counting Method
  327. C Program To Segregate 0’s and 1’s In An Array using Swapping Method
  328. C Program To Search A Number And Count Its Occurrence In An Array
  329. C Program To Find Largest Difference Between Two Elements of Array
  330. C Program To Display Elements of Array In Reverse Order using Pointers
  331. C Programming: Arrays, Pointers and Functions
  332. C Program To Count Positive, Negative, Even And Odd Numbers In An Array
  333. C Program To Find Biggest Element of An Array using Recursion
  334. C Program To Find Smallest Element in An Array using Recursion
  335. C Program To Find Smallest Element in An Array using Pointers
  336. C Program To Find First and Second Biggest Element In An Array using Recursion
  337. Find Prime Numbers from 2 To N using Sieve of Eratosthenes: C Program
  338. Prime Numbers using Sieve of Eratosthenes: C Program
  339. C Program to Print Integer Numbers Till N

Ionic Storage Module: Ionic 2

This video tutorial is an update to our previous tutorial Ionic Storage: Ionic 2.

Major Changes To Note
Previously we use to import Storage class inside src/app/app.module.ts file and we would list it as one of the providers. But now we need to import IonicStorageModule class inside src/app/app.module.ts file and list it inside imports array. That’s the only difference in implementing Ionic Storage, everything else is as described in Ionic Storage: Ionic 2 video tutorial.

Database

In this video tutorial only concentrate on src/app/app.module.ts file and for implementing storage set and get method refer Ionic Storage: Ionic 2 video tutorial itself.

Ionic Storage Module In Ionic 2 (Update)


[youtube https://www.youtube.com/watch?v=lKsspk5kafE]

YouTube Link: https://www.youtube.com/watch?v=lKsspk5kafE [Watch the Video In Full Screen.]



src/app/app.module.ts

import { NgModule, ErrorHandler } from '@angular/core';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
 
import { IonicStorageModule } from '@ionic/storage';
 
@NgModule({
  declarations: [
    MyApp,
    HomePage
  ],
  imports: [
    IonicModule.forRoot(MyApp),
    IonicStorageModule.forRoot()
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    HomePage
  ],
  providers: [
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]
})
export class AppModule {}

Here we import IonicStorageModule class and list it inside imports array. We can also specify database name and database preference as follows:

imports: [
    IonicModule.forRoot(MyApp),
    IonicStorageModule.forRoot({
      name: '__mydbName',
      driverOrder: ['sqlite', 'indexeddb', 'websql']
    })
  ]

Now implementing get and set methods wherever we need it. Practically it would be useful inside a data provider file, but in this tutorial am implementing inside a normal page, so that I keep the complexities out for this basic lesson.

src/pages/home/home.ts

import { Component } from '@angular/core';
 
import { NavController } from 'ionic-angular';
 
import { Storage } from '@ionic/storage';
 
@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {
 
  constructor(public storage: Storage, public navCtrl: NavController) {
    this.storage.ready().then(() => {
     this.storage.set('myKey', 10);
    });
  };
 
  getValues(){
     this.storage.get('myKey').then((data) => {
       if(data != null)
       {
         console.log(data);
       }
     });
  };

Here we import Storage class and create an instance of it. We check if the storage is ready. Once its ready it returns/resolves a promise. So now we can set value using this.storage.set() method. We can set an object, an array or a strong value or simply a number.

We can get the value by using its get method, which returns the value stored in the key as promise. If nothing is stored in the key, it returns null.

Using Ionic Native: Ionic 2

Today lets learn about an important project which helps us use 130+ native mobile SDK features in our Ionic application through simple JavaScript interfaces – Ionic Native.

ionic native ionic2

Ionic Native is a TypeScript wrapper for Cordova/PhoneGap plugins that make adding any native functionality you need to your Ionic 2 mobile app easy. Ionic Native wraps plugin callbacks in a Promise or an Observable, providing a common interface for all plugins and ensuring that native events trigger change detection in Angular 2.

Related Read:
Ionic 2 Starter Templates.
Adding AdMob In Ionic 2.

Using ‘Ionic Native’ In Ionic 2 Applications


[youtube https://www.youtube.com/watch?v=SM54loG63ks]

YouTube Link: https://www.youtube.com/watch?v=SM54loG63ks [Watch the Video In Full Screen.]



There are two steps required to use Ionic Native in our project
1. Install the Ionic Native package for each plugin you want to add.
2. Install the plugin using Cordova or Ionic CLI.

For example:
If we want to add AdMob plugin to our application:
Step 1: Add/ Install Specific Ionic Native package

npm install --save @ionic-native/ad-mob

Step 2: Add / install the plugin using Cordova or Ionic CLI.

ionic plugin add cordova-plugin-admobpro

Additional Implementation
Listing Plugin Class as Provider: src/app/app.module.ts

import { AdMob } from '@ionic-native/ad-mob';
import { NgModule, ErrorHandler } from '@angular/core';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
 
 
 
@NgModule({
  declarations: [
    MyApp,
    HomePage
  ],
  imports: [
    IonicModule.forRoot(MyApp)
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    HomePage
  ],
  providers: [
    AdMob,
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]
})
export class AppModule {}

Look at the first import statement in above code snippet. We import AdMob plugin and the way we import is specific to ad-mob and we do not import the whole ionic native script here – thus saving application load time.

Also specify the class name as provider. Because we use the services provided by this class in our application.

Working of plugin: src/app/app.component.ts

import { AdMob } from '@ionic-native/ad-mob';
import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
 
import { HomePage } from '../pages/home/home';
 
@Component({
  templateUrl: 'app.html'
})
export class MyApp {
  rootPage:any = HomePage;
 
  constructor(public admob: AdMob, platform: Platform) {
    platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
 
      this.admob.createBanner({
        adId: 'ca-app-pub-5732334124058455/4262868443',
        isTesting: false,
        autoShow: false
      }).then(() => {
        this.admob.showBanner(8);
      });
 
    });
  }
}

Again, we import AdMob native code wherever we want to implement the service of this plugin. We create instance of the class we want to implement – as constructor argument. Then inside platform.ready() method we call the methods of these classes and implement its services inside our project.

Trouble Shoot
1. If you’re getting ‘plugin not found‘ error. OR Cannot find module “@ionic-native/ “ errors, then follow below commands to fix it.

npm rebuild
npm install

2. Error Message “Provider Not Found:
Make sure to include all the specific packages inside src/app/app.module.ts file and list its class name inside providers array.