how to reverse string "Hello World" by using pointers only.
Without any temp var
Answer / aravind
#include<stdio.h>
char reverse(char *, char *);
int main()
{
char a[]="hello"
char b[]="world";
gets(a,b);
puts(a); /*displays Hello world*/
reverse(a,b);
char reverse(char *ptr, char *ptr1)
{
int i,j;
for(i=0;i!='\0';i++)
{
printf("%s",*ptr);
ptr++;
}
for(j=0;j!='\0';j++)
{
printf("%s",*ptr1);
ptr1++;
}
gets(*ptr1,*ptr);
puts(*ptr1); /*displays world hello*/
}
Is This Answer Correct ? | 0 Yes | 10 No |
main() {int i=5; // line 1 i=(++i)/(i++); // line 2 printf("%d",i); // line 3 } output is 2 but if we replace line 2 and line 3 by printf("%d",i=(++i)/(i++)); then output is 1. Why?
What is structure of c program?
what are you see during placement time in the student.
0 Answers Goldman Sachs, TCS, Tech Solutions,
with out using main how to execute the program?
Write a program to generate prime factors of a given integer?
What is typedef?
Is both getch() and getchar() functions are similar? if it is similar means why these two functions are used for same usage? if it is not similar means what is the difference?
write a program in c language for the multiplication of two matrices using pointers?
How do you write a program which produces its own source code as output?
Explain the properties of union.
design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?