C program to swap two numbers using call by reference

Write a C program to swap two numbers using pointers and functions. How to swap two numbers using call by reference method. Logic to swap two number using pointers in C program.

Example

Input

Input num1: 10
Input num2: 20

Output

Values after swapping:
Num1 = 20
Num2 = 10

Read more

C program to add two numbers using pointers

Write a C program to read two numbers from user and add them using pointers. How to find sum of two number using pointers in C programming. Program to perform arithmetic operations on number using pointers.

Example

Input

Input num1: 10
Input num2: 20

Output

Sum = 30
Difference = -10
Product = 200
Quotient = 0

Read more

C program to find the first occurrence of a character in a string

Write a C program to input any string from user and find the first occurrence of a given character in the string. How to find the first occurrence of a given character in a string in C programming. Logic to find first occurrence of a character in a string in C programming.

Example

Input

Input string: I love Codeforwin.
Input character to search: o

Output

'o' is found at index 3

Read more

C program to compare two strings

Write a C program to compare two strings using loop character by character. How to compare two strings without using inbuilt library function strcmp() in C programming. Comparing two strings lexicographically without using string library functions. How to compare two strings using strcmp() library function.

Example

Input

Input string1: Learn at Codeforwin.
Input string2: Learn at Codeforwin.

Output

Both strings are lexographically equal.

Read more

C program to concatenate two strings

Write a C program to concatenate two strings in single string. How to concatenate two strings to one without using strcat() library function. Adding two strings into one without using inbuilt library function. Logic to concatenate two strings in C programming. C program to concatenate two strings using strcat() library function.

Example

Input

Input string1: I love
Input string2: Codeforwin

Output

Concatenated string: I love Codeforwin

Read more

C program to copy one string to another string

Write a C program to copy one string to another string using loop. C program to copy one string to another without using inbuilt library function strcpy(). How to copy one string to another without using inbuilt string library function in C programming. Effective logic to copy strings in C programming. How to copy one string to another string using strcpy() function in C program.

Example

Input

Input string: I love Codeforwin!

Output

Original string: I love Codeforwin!
Copied string: I love Codeforwin!

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