how can i get the string which is having two spaces at the
end.suppose the string is "Hello World ".Now at the end i
have two spaces.i need to print with that spaces .



how can i get the string which is having two spaces at the end.suppose the string is "Hello W..

Answer / banavathvishnu

char *str = "Hello World ";
puts(str);

Is This Answer Correct ?    4 Yes 1 No

Post New Answer

More C Interview Questions

using only #include <stdio.h> and #include <stdlib.h> Write a program in C that will read an input from the user and print it back to the user if it is a palindrome. The string ends when it encounters a whitespace. The input string is at most 30 characters. Assume the string has no spaces and distinguish between and lowercase. So madam is a palindrome, but MadAm is not a palindrome. Use scanf and %s to read the string. Sample Test: Enter a string: madam madam is a palindrome. Enter a string: 09023 09023 is not a palindrome.

0 Answers  


What is assignment operator?

0 Answers  


GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)

0 Answers  


For what purpose null pointer used?

0 Answers  


Hi, main() { } Is a user defined function or Built in Functionn

26 Answers   Honeywell, Yahoo,






What do you mean by scope of a variable in c?

0 Answers  


What is %g in c?

0 Answers  


Unsigned char c; for ( c=0;c!=256;c++2) printf("%d",c); No. of times the loop is executed ?

8 Answers   Mascot, TCS,


struct abc { unsigned int a; char b; float r; }; struct xyz { int u; struct abc tt; }ww; ww = (struct xyz*)malloc(sizeof(struct xyz)); will the memory be allocated for the inner structure also?

1 Answers   Wipro,


What are variables and it what way is it different from constants?

0 Answers  


What is realloc in c?

0 Answers  


Q-1: Create a structure to specify data on students given below: Roll number, Name, Department, Course, Year of joining Assume that there are not more than 450 students in the college.

8 Answers  


Categories