How to find the size of data type using sizeof() operator in C

Sizeof(type) is a unary operator used to calculate the size(in bytes) of any datatype in C. Syntax: sizeof(type)Note: type must be replaced by a valid C data type or variable. Example: #include <stdio.h>int main(){ int i; printf(“Size of int = %dn”, sizeof(int)); printf(“Size of i = %dn”, sizeof(i)); return 0;} Output: Size of int = … Read more

List of all format specifiers in C programming

In C programming we need lots of format specifier to work with various data types. Format specifiers defines the type of data to be printed on standard output. Whether to print formatted output or to take formatted input we need format specifiers. Format specifiers are also called as format string.

Read more

Introduction to Programming – Errors

Errors are the mistakes or faults in the program that causes our program to behave unexpectedly and it is no doubt that the well versed and experienced programmers also makes mistakes. Programming error are generally known as Bugs and the process to remove bugs from program is called as Debug/Debugging. There are basically three types … Read more

What are Tokens in programming

Smallest individual element of a program is called as Token. Everything you see inside a program is a token.

For example – Suppose an English sentence. “C language is an awesome language. C was developed by Dennis Ritchie at AT&T Bell labs in 1972.”

The above sentence is made of Alphabets (a-z A-Z), Blank spaces, Digits (0-9) and special characters (full stop in our case). These are building blocks or basic elements of our sentence. Similarly there are various basic programming elements that makes any program.

There are five types of tokens.

  1. Keyword
  2. Identifier
  3. Operator
  4. Separator
  5. Literal

Read more

C program to convert string to lowercase

Write a C program to convert uppercase string to lowercase using for loop. How to convert uppercase string to lowercase without using inbuilt library function strlwr(). How to convert string to lowercase using strlwr() string function.

Example

Input

Input string: I love CODEFORWIN.

Output

Lowercase string: i love codeforwin.

Read more

C program to convert lowercase string to uppercase

Write a C program to convert string from lowercase to uppercase string using loop. How to convert string from lowercase to uppercase using for loop in C programming. C program to convert lowercase to uppercase string using strupr() string function.

Example

Input

Input string: I love Codeforwin.

Output

I LOVE CODEFORWIN.

Read more

C program to find reverse of a string

Write a C program to find reverse of a given string using loop. How to find reverse of any given string using loop in C programming. Logic to find reverse of a string without using strrev() function in C. C program to reverse a string using strrev() string function.

Example

Input

Output

Reverse string: olleH

Read more

C program to count total number of vowels and consonants in a string

Write a C program to find total number of vowels and consonants in a string using loop and if else. How to find total number of vowels and consonants in a string using switch case in C programming. Logic to count number of vowels and consonants in a string.

Example

Input

Input string: I love Codeforwin.

Output

Total Vowels = 7
Total Consonants = 8

Read more

C program to find length of a string

Write a C program to find length of a string using loop. How to find length of a string without using in-built library function strlen() in C programming. Effective way to find length of a string without using strlen() function. How to find length of a string using strlen() string function.

Example

Input

Input string: I love programming. I love Codeforwin.

Output

Length of string: 38

Read more