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 |
main() { show(); } void show() { printf("I'm the greatest"); }
What is the output of the program given below main() { signed char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
#define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }
4 Answers Google, HCL, Quick Heal, WTF,
main() { unsigned int i=10; while(i-->=0) printf("%u ",i); }
main() { int x=5; clrscr(); for(;x<= 0;x--) { printf("x=%d ", x--); } } a. 5, 3, 1 b. 5, 2, 1, c. 5, 3, 1, -1, 3 d. ā3, -1, 1, 3, 5
how can i cast a char type array to an int type array
write a c-program to display the time using FOR loop
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; } }
void main() { int i; char a[]="\0"; if(printf("%s\n",a)) printf("Ok here \n"); else printf("Forget it\n"); }
program to find the roots of a quadratic equation
14 Answers College School Exams Tests, Engineering, HP, IIIT, Infosys, Rajiv Gandhi University of Knowledge Technologies RGUKT, SSC,
main() { int i=5; printf(ā%dā,i=++i ==6); }
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.