Category: C

Escape Sequence in C

Escape Sequence in C: An escape sequence in C language is a sequence of characters that doesn’t represent itself when used inside string literal or character. It is composed of two or more characters starting with backslash \. For example: \n represents new line. List of Escape Sequences in C: Escape Sequence Meaning \a Alarm […]

ASCII value in C

ASCII value in C: What is ASCII code? The full form of ASCII is the American Standard Code for information interchange. It is a character encoding scheme used for electronics communication. Each character or a special character is represented by some ASCII code, and each ascii code occupies 7 bits in memory. In C programming language, a […]

Difference Between Type Casting and Type Conversion in C

Difference Between Type Casting and Type Conversion The two terms type casting and type conversion are used in a program to convert one data type to another data type. The conversion of data types is possible only by the compiler when they are compatible with each other. Let’s discuss the difference between type casting and type conversion […]

C Program to generate Fibonacci Triangle

C Program to generate Fibonacci Triangle: In this program, we are getting input from the user for the limit for fibonacci triangle, and printing the fibonacci series for the given number of times (limit). Let’s see the c example to generate fibonacci triangle. #include<stdio.h>   #include<stdlib.h> int main(){ int a=0,b=1,i,c,n,j; system(“cls”); printf(“Enter the limit:”); scanf(“%d”,&n); for(i=1;i<=n;i++) { a=0; b=1; printf(“%d\t”,b); […]

C Program to print “hello” without semicolon

C Program to print “hello” without semicolon We can print “hello” or “hello world” or anything else in C without using semicolon. There are various ways to do so: Using if Using switch Using loop etc. Program 1: Using if statement Let’s see a simple c example to print “hello world” using if statement and […]

C Program to reverse number

C Program to reverse number: We can reverse a number in c using loop and arithmetic operators. In this program, we are getting number as input from the user and reversing that number. Let’s see a simple c example to reverse a given number. #include<stdio.h> int main() { int n, reverse=0, rem; printf(“Enter a number: “); scanf(“%d”, &n); while(n!=0) { rem=n%10; reverse=reverse*10+rem; n/=10; […]