Skip to content

Category Archives: C Programs

Given string str. The task is to find the length of the string using %n format specifier Examples: Input: Geeks For Geeks Output: 15 Input:… Read More
The localtime() function is defined in the time.h header file. The localtime( ) function return the local time of the user i.e time present at… Read More
Given a word str, the task is to print the alphabets of this word using * pattern.Examples:   Input: GFG Output: ****** * * * *… Read More
NULL pointer in C At the very high level, we can think of NULL as a null pointer which is used in C for various… Read More
Given a string str and a character ch, this article tells about how to append this character ch to this string str at the end.Examples:  … Read More
The time.h header file contains definitions of functions to get and manipulate date and time information. It describes three time related datatypes. clock_t: clock_t represents… Read More
Prerequisites: Socket Programming in C/C++, TCP and UDP server using select, UDP Server-Client implementation in C TCP Client-Server Implementation in C This article describes a… Read More
Below are some more interesting facts about C programming: 1. Macros can have unbalanced braces: When we use #define for a constant, the preprocessor produces… Read More
Given student’s records with each record containing id, name and age of a student. Write a C program to read these records and display them… Read More
Problem: Write a Lex program for Decimal to Hexadecimal conversion. Explanation: Lex reads an input stream specifying the lexical analyzer and outputs source code implementing… Read More
Problem: Write a Lex program to find the Length of a String Explanation: FLEX (Fast Lexical Analyzer Generator) is a computer program that generates lexical… Read More
Lex is a computer program that generates lexical analyzers and was written by Mike Lesk and Eric Schmidt. Lex reads an input stream specifying the… Read More
Given a text file as input, the task is to replace a given word with another word in the file. Lex is a computer program… Read More
Problem: Write a Lex program to search a word in a file. Explanation: FLEX (Fast Lexical Analyzer Generator) is a tool/computer program for generating lexical… Read More
Lex is a computer program that generates lexical analyzers. Lex reads an input stream specifying the lexical analyzer and outputs source code implementing the lexer… Read More