write a program to print the consecutive repeated character
from the given string...
input string is : hhhhjkutskkkkkggggj
output should be like this: hhhhkkkkkgggg
anyone help me...
Answer / Mohd Tarique Khan
In C, you can use the following code to solve this problem:nn```n#include <stdio.h>n#include <string.h>nnint main() {n char str[] = "hhhhjkutskkkkkggggj";n int i, j;n for (i = 0; i <= strlen(str); i++) {n if ((i+1) < strlen(str)) {n if (str[i] == str[i+1]) {n for (j = i; j < strlen(str); j++) {n printf "%c", str[j]);n i = strlen(str);n }n }n }n return 0;n}n```
| Is This Answer Correct ? | 0 Yes | 0 No |
To what value do nonglobal variables default? 1) auto 2) register 3) static
Why is void main used?
How the C program can be compiled?
print a "hello" word without using printf n puts in c language
There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,another has combination of apple and orange,what is the least way of interchange the lables.
15 Answers Cisco, Google, MBT,
Is there sort function in c?
What is the use of a semicolon (;) at the end of every program statement?
WHY DO WE USE A TERMINATOR IN C LANGUAGE?
You have an array of n integers, randomly ordered with value 1 to n-1.The array is such that there is only one and one value occurred twice. How will you find this number?
what is the program to display your name in any color?
what does " calloc" do?
Why c is a procedural language?