How to reverse a String without using C functions ?
Answers were Sorted based on User's Feedback
Answer / snjui
#include<stdio.h>
#include<conio.h>
void main()
{
getch()
}
Is This Answer Correct ? | 2 Yes | 14 No |
Answer / saurabh
int i=0,j=0;
while(str[i++))
{j++;}
i=0;
j--;
while(i<j)
{ char tmp;
tmp = str[i];
str[i]=str[j];
str[j]=tmp;
}
Is This Answer Correct ? | 20 Yes | 40 No |
Answer / prof.muthu
#include<muthu.h>
main()
{
printf("\nthe reverse string is:",reversemuthu(s1);
}
output:
original string is: muthu
the reverse string is: uthum
Thanks and recgards:
prof.muthu ph:9962940220
you can call me any time any where...!
Is This Answer Correct ? | 20 Yes | 138 No |
{ int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }
main() { extern int i; i=20; printf("%d",sizeof(i)); }
main(int argc, char *argv[]) { (main && argc) ? main(argc-1, NULL) : return 0; } a. Runtime error. b. Compile error. Illegal syntax c. Gets into Infinite loop d. None of the above
main() { int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }
main() { int i, j, *p; i = 25; j = 100; p = &i; // Address of i is assigned to pointer p printf("%f", i/(*p) ); // i is divided by pointer p } a. Runtime error. b. 1.00000 c. Compile error d. 0.00000
Which version do you prefer of the following two, 1) printf(ā%sā,str); // or the more curt one 2) printf(str);
main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }
to remove the repeated cahracter from the given caracter array. i.e.., if the input is SSAD output should of SAD
#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }
void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %d\n",++i); }
Write a single line c expression to delete a,b,c from aabbcc
How do I write a program to print proper subset of given string . Eg :input: abc output:{},{a},{b},{c},{a,b},{a,c},{b,c}, {a,b,c}.I desperately need this program please mail me to saravana6m@gmail.com