Author: learnconline

Introduction to C Programming 97

Introduction to C Programming Language

Resource download – C Character set PDF (Click here to download) The above video is an extract from the online course – “C Programming: The ultimate guide for beginners” which we are currently working on. Consider subscribing to Youtube channel – Aptuts in order to get latest updates on new videos and online C programming course. C programming is a language developed by AT & T’s Bell Laboratories of USA in 1972. It was designed and written by a man named Dennis Ritchie. C language is reliable, simple and easy to use. It has survived for more than 4 decades....

Variables, Constants an Keywords in C Programming 53

Variable, Constant and Keyword in C

Resource download – List of C keywords PDF (Click here to download) The above video is an extract from the online course – “C Programming: The ultimate guide for beginners” which we are currently working on. Consider subscribing to Youtube channel – Aptuts in order to get latest updates on new videos and online C programming course. Variable, constant or keyword in C can be formed from any combination of Alphabets, Digits and Special Symbols. A constant in C programming is an entity whose value does not change throughout the program execution. A variable in C is an entity whose...

Learn C - understanding c programming 47

Learn C with help of an example

In this article, we will learn C by going through the below program and understanding each line of C code in detail. 1) /* 2) Program: 3) Addition of two numbers 4) */ 5) //Here it starts 6) #include<stdio.h> 7) #include<stdlib.h> 8) void main() 9) { 10) int a, b, c; 11) /*Assign the values to the variable a and b */ 12) a = 5; 13) b = 4; 14) /*Perform addition of a and b */ 15) c = a + b; 16) printf(“\nAddition of a and b is %d”, c); 17) } Let us learn C by...

c programming write text 2

Program to write a text to a file

We will write a program in C that will accept a string from the user and write the string in a file. In this program, we will use fopen function in order to open a file. We will also use fputs function which will write a string to a file. Below is the program: #include<stdio.h> #include<conio.h> void main() { char *str; FILE *fp; //Open the file in write mode fp = fopen(“write.txt”, “w”); printf(“Enter a string: “); gets(str); //write string in a file fputs(str, fp); getch(); } C Programming is brought you by LearnCOnline.com

2

Program to display right angled triangle of star (asterisk)

Below the program in C that will display right angled triangle of star/asterisk. The program will use for and while loop to display the star/asterisk on the screen. Expected Output * ** *** Here is the code, #include<stdio.h> #include<conio.h> void main() { int i, counter; clrscr(); for(i=0; i<3; i++) { counter = 0; while(counter <= i){ printf(“*”); counter++; } printf(“\n”); } getch(); } This C Program is brought you by LearnCOnline.com

C programming read text from a file and display it on screen 1

Program to read text from a file and display it on screen

We will write a program in C that will read a text file character by character and displays it on the screen. In order to achieve it, we will use fopen function that will open the file from the disk. We will also use fgetc function which will read the file character by character and then display the content of the string character by character. #include<stdio.h> #include<conio.h> void main() { FILE *fp; char ch; fp = fopen(“file1.C”,”r”); while(1) { ch = fgetc(fp); if (ch == EOF) break; printf(“%c”, ch); } getch(); fclose(fp); } C Programming is brought you by LearnCOnline.com

FREE C Cheatsheet - Speed Up Your C Programming.

FREE C Cheatsheet - Speed Up Your C Programming.

Download a 7-page free cheat sheet for easy and quick access to C Concepts, Snippets, and Syntax.

Thank you! Check you inbox and access your cheat-sheet