Skip to main content

Posts

Featured

Time conversion from 12hr to 24hr format in C

There will somewhat struggle while converting the time in the 24hr format in string array or pointer. But the solution provided here will be very simple and easy to understand to convert time in C SAMPLE I/P 07:05:45PM O/P 19:05:45 SOLUTION: char* timeConversion(char* s) {           // s is a string pointer which contains time format     if(*(s+8) == 'P'){         int a = *(s+0) - 48;                         // integer a gets first digit in HR         int b = *(s+1) - 48;                        // integer b gets second digit in HR         int c = a*10 + b;                             // integer c is HR         if(c!=12){         ...

Latest Posts

Count substrings with same first and last characters

How many digits after decimal point can be determined?

Remove a character from a string to make it a palindrome

Print all palindromic partitions of a string

Minimum characters to be added at front to make string palindrome

Pattern Syntax Checker

Java String Tokens