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 |
struct Foo { char *pName; char *pAddress; }; main() { struct Foo *obj = malloc(sizeof(struct Foo)); clrscr(); obj->pName = malloc(100); obj->pAddress = malloc(100); strcpy(obj->pName,"Your Name"); strcpy(obj->pAddress, "Your Address"); free(obj); printf("%s", obj->pName); printf("%s", obj->pAddress); } a. Your Name, Your Address b. Your Address, Your Address c. Your Name Your Name d. None of the above
#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }
Write a Program that Inputs 10 Numbers in an Array and Show the Maximum Number
#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d..%d",*p,*q); }
What is wrong with the following code? int *foo() { int *s = malloc(sizeof(int)100); assert(s != NULL); return s; }
why array index always strats wuth zero?
Write a routine that prints out a 2-D array in spiral order
main() { char *p = "hello world"; p[0] = 'H'; printf("%s", p); } a. Runtime error. b. “Hello world” c. Compile error d. “hello world”
How can u say that a given point is in a triangle? 1. with the co-ordinates of the 3 vertices specified. 2. with only the co-ordinates of the top vertex given.
void main() { while(1){ if(printf("%d",printf("%d"))) break; else continue; } }
prog. to produce 1 2 3 4 5 6 7 8 9 10
#define f(g,g2) g##g2 main() { int var12=100; printf("%d",f(var,12)); }