To find the non repeating characters in a given string, we will first iterate the each characters of string and records the count. To records the counts we will have one more integer array which will store the frequency of each characters. At last will print only those character that occurs only one time.
How our program will behave?
- Our program will take one string as an input.
- We will have one extra integer array to keep the frequency of all characters of string.
- Now we will print only those characters that occurs only once in string.
C Program to print all non repeating characters in string
#include <stdio.h> int main() { //Initializing variables. char str[100]; int i; int freq[256] = {0}; printf("C Program to find all non repeating character\n"); printf("Enter the string: "); scanf("%[^\n]",str); //Here we are calculating the frequency of all characters for(i = 0; str[i] != '\0'; i++) { freq[str[i]]++; } printf("Character which has no repetitions are \n"); for(i = 0; i < 256; i++) { //Here is the check to print only character //which has came only once if(freq[i] == 1) { printf("%c ", i); } } return 0; }
Output

Also Prepare Below Important Question
- Python Program to add two number using Recursion
- Python Program to Find Highest Frequency Element in Array
- Python Program to Merge two Arrays
- Perform left rotation by two positions in Array Using Python
- Python Program to Delete Element at Given Index in Array
- Python Program to Delete element at End of Array
- Python Program to Copy one String to Another String
- Python Program to Remove Repeated Character from String
- Print highest frequency Character in String in Python
- Python Program to Convert lowercase vowel to uppercase
- Convert Celsius to Fahrenheit in Python
- Leap Year Program in Python
- Python Program to convert Decimal to Octal number
- Python Program to Convert Decimal Number into Binary
- Find all Pairs Whose Sum is Equal to Given number in Python
- Python Program to Replace First Vowel With ‘-‘ in String
- Python Program to find Prime factors of given integer
- Python Program to Print Prime Number in given range
- Java Program to Perform Left Rotation on Array Elements by Two
- Java Program to Perform Right Rotation on Array Elements by Two
Interview Questions Categories
C Programming Interview Preparation
Core Java Programming Interview Preparation
- Core Java Programming Coding Questions
- Core Java Pattern Programming Questions
- Core Java Programming Interview Questions