write a program in reverse the string without using
pointer,array,global variable declaration,lib fun only using
a function?
Answers were Sorted based on User's Feedback
Answer / r.s.guptha
void reverse()
{
char c = getchar();
if(c=='\n' || c=='\r')
return;
else
reverse();
putchar(c);
}
int main()
{
reverse();
return 0;
}
| Is This Answer Correct ? | 4 Yes | 3 No |
Answer / reshma pawar
#include<stdio.h>
void main()
{
int i;
char a[]={"Hello"};
printf("Reverse String is: ");
for(i=4;i>=0;i--)
printf("%c",a[i]);
}
| Is This Answer Correct ? | 14 Yes | 15 No |
Answer / sanjay
#include<stdio.h>
int main()
{
char a[10],b[10];
int i,c=0;
printf("Enter string");
scanf("%s",a);
for(i=0;a[i]!='\0';i++)
{
c=c+1;
}
for(i=c-1;i>=0;i--)
{
b[j]=a[i];
j++;
}
b[j]='\0';
printf("Reverse the string %s",b);
return 0;
}
| Is This Answer Correct ? | 6 Yes | 11 No |
#include<stdio.h>
#include<conio.h>
void main()
{
FILE *f;
char c;
clrscr();
f=fopen("string","w");
while((c=getchar())!=EOF)
{
putc(c,f);
}
fclose(f);
f=fopen("string","r");
fseek(f,-1L,2);
do
{
putchar(getc(f));
}
while(!fseek(f,-2L,1));
fclose(f);
getch();
}
| Is This Answer Correct ? | 0 Yes | 7 No |
Answer / aravind
#include<stdio.h>
int main()
{
int i;
char a={"Hello"};
for(i=4;i>=0;i--)
printf("revese string=%c",a);
}
| Is This Answer Correct ? | 7 Yes | 32 No |
Identify the correct argument for the function call fflush () in ANSI C: A)stdout B)stdin C)stderr D)All the above
In the following control structure which is faster? 1.Switch 2.If-else and which consumes more memory?
Are pointers really faster than arrays?
write a program to sort the elements in a given array in c language
What is wrong with this statement? Myname = 'robin';
What is the difference between null pointer and the void pointer?
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
writ a program to compare using strcmp VIVA and viva with its output.
do ne body have any idea about the salary for the we r going to have interview. yup .. u got it right ..i m talking abt NIC.
1. Write a C program to count the number of occurrence of a specific word in the given strings. (for e.g. Find how many times the word “live” comes in the sentence “Dream as if you’ll live forever, live as if you’ll die today ”)
What is the diffrent between while and do while statement ?
1.What is a Data Structure? Explain its need? 2.What is a Directed Graph? Write an algorithm to find whether a Directed Graph is connected or not? 3.Explain the process of converting a Tree to a Binary Tree.