Sunidhi Bansal has Published 1100 Articles

Print the string after the specified character has occurred given no. of times in C Program

Sunidhi Bansal

Sunidhi Bansal

Updated on 08-Aug-2019 10:18:04

666 Views

Task is to print the given after the specified character occurrence for given number of times which is specified by the userInput : string = {“I am harsh vaid “}    Char =’a’    Count =2 Output : rsh vaidIt means user specified character ‘a’ and its occurrence 2 so ... Read More

C Program for Print the pattern by using one loop

Sunidhi Bansal

Sunidhi Bansal

Updated on 08-Aug-2019 09:27:32

3K+ Views

The challenge is to display the pattern using one loop only and with continue statement.AlgorithSTART Step 1 -> declare start variables i and j to 0 with number of rows in n to 6 Step 2 -> Loop For i=1 and i

Print longest palindrome word in a sentence in C Program

Sunidhi Bansal

Sunidhi Bansal

Updated on 08-Aug-2019 09:12:57

1K+ Views

Given a sentence and the challenge is to find the longest palindrome from the given sentenceWhat is a Palindrome?Palindrome is a word or sequence whose meaning remains same even after reversing the stringExample − Nitin, after reversing the string its meaning remains the same.Challenge is to find the longest palindrome ... Read More

Print n 0s and m 1s such that no two 0s and no three 1s are together in C Program

Sunidhi Bansal

Sunidhi Bansal

Updated on 08-Aug-2019 09:08:00

140 Views

There should be sequence of N 0’s and M 1’s such that the sequence so formed shouldn’t contain two consecutive 0’s with three consecutive 1’s.Input − N=5 M=9Output − 1 1 0 1 1 0 1 1 0 1 0 1 0 1Note − To make the above sequence, the statement (m ... Read More

C Program for Print individual digits as words without using if or switch.

Sunidhi Bansal

Sunidhi Bansal

Updated on 08-Aug-2019 09:02:44

223 Views

Print the given numeric value as words. It’s easy to do with switch using cases from 0-9 but challenge is without using them.Input  − N=900Output − NINE ZERO ZEROIt is possible by creating array of pointers that contains 0-9 in words.AlgorithmSTART Step 1 -> declare int variables num, i and ... Read More

Print first k digits of 1/n where n is a positive integer in C Program

Sunidhi Bansal

Sunidhi Bansal

Updated on 08-Aug-2019 08:59:15

117 Views

Input number N such that 1/N will return the output generated as decimal specified till the limit.It is easy with Floating Point numbers but the challenge is without using them.Input − n=5 k=5Output − 20000It means if n=5 and k=5 than after dividing 1/5 the output should be displayed till 5 decimal ... Read More

Print multiples of Unit Digit of Given Number in C Program

Sunidhi Bansal

Sunidhi Bansal

Updated on 08-Aug-2019 08:50:18

5K+ Views

Input number N and fetch the unit digit of a given number and display the multiples of that number.Input − N=326Output − unit digit is 6 and its multiples are 2 and 3Note − Unit digit of any number can be fetched by calculating the %10 with that numberFor example − if ... Read More

Print n numbers such that their sum is a perfect square

Sunidhi Bansal

Sunidhi Bansal

Updated on 30-Jul-2019 22:30:26

132 Views

Given with n numbers program must find those n number whose sum is a perfect squareInput : 5 Output : 1 3 5 7 9 1+3+5+7+9=25 i.e (5)^2AlgorithmSTART    Step 1 : Declare a Macro for size let’s say of 5 and i to 1    Step 2: loop While ... Read More

Print number of words, vowels and frequency of each character

Sunidhi Bansal

Sunidhi Bansal

Updated on 30-Jul-2019 22:30:26

262 Views

Input a string and find the total number of words, vowels and frequency of a character enter by a userInput : enter s string : I love my MOM      Enter a charcter of which you want to find a frequency: M    Total frequency of M : 2 ... Read More

Print the given 3 string after modifying and concatenating

Sunidhi Bansal

Sunidhi Bansal

Updated on 30-Jul-2019 22:30:26

171 Views

Input three strings and replace each string with a character which user has entered and then display edited strings. After that, concatenate edited strings and display them.Input:    string 1 : tutorials replacement character for string 1 : x    String 2 : points replacement character for string 2 : ... Read More

Advertisements