How to removing white spces in c programming only bu using
loops
Answers were Sorted based on User's Feedback
Answer / ranj
Aravind has done few mistake in printing the no,
the correct format should like this
int main()
{
int i,number;
char str[10];
gets(str);
number=strlen(str);
printf("String without white space\n");
for(i=0;i<number;i++)
{
if(str[i]==' ');
else
printf("%c",str[i]);
}
}
Is This Answer Correct ? | 5 Yes | 0 No |
Answer / aravind
int main()
{
int i;
char str[10];
gets(str);
for(i=0;i<=number;i++)
{
if(str[i]==' ')
str[i]=0;
}
printf("string without white space is=%s",str);
}
Is This Answer Correct ? | 0 Yes | 3 No |
12. Look at the Code: main() { int a[]={1,2,3},i; for(i=0;i<3;i++) { printf("%d",*a); a++; } } Which Statement is/are True w.r.t the above code? I.Executes Successfully & Prints the contents of the array II.Gives the Error:Lvalue Required III.The address of the array should not be changed IV.None of the Above. A)Only I B)Only II C)II & III D)IV
Tell us bitwise shift operators?
What is the need of structure in c?
write program on arrays
Given an array of numbers, except for one number all the others occur twice. Give an algorithm to find that number which occurs only once in the array.
how to generate the length of a string without using len funtion?
what will be the output for the following main() { printf("hi" "hello"); }
write a program of bubble sort using pointer?
What is an arrays?
How would you sort a linked list?
main() { int i; for(i=0;i<5;i++) printf("%d",1l<<i); } why doesn't 'l' affect the code??????
How would you use the functions fseek(), freed(), fwrite() and ftell()?
0 Answers Aspire, Infogain, TISL,