Category Archives: String

String and Hackerearth

String Upper:

String Lower:

Lower Upper Both:

Hackerearth Problem:: Toggle String

Another Approach:

Another Approach:

 

Helpful Link: http://www.programmingsimplified.com/c/program/c-program-change-case

Some string functions

puts()

in c i will implement.
Main job of this function is to print a new line autoamtically where printf() does not give this.

example:

putchar()

The actual work of putchar is it display string as character by character putchar is a macro that outputs character on stdout.

and the basic is : putchar(‘a’)    // it will print a
and putchar(a);     //it will print the value in stored in a
And the basic parameters of this is:
int putchar(int c);

Take input in string:

In string we don’t mention ampersand & sign as string automatically take it as address.

catcpy.c

String equality:

String Lower:

String Upper:

strdup.c

strstr.c

 

 

Reference for some examples:
http://fresh2refresh.com/c-programming/c-strings/

http://www.apiexamples.com/c/string/strstr.html

Length of a input string

Another method:

With while loop:

 

 

 

Uppercase to Lowercase

Lowercase to Uppercase

Uppercase to Lowercase

another method: