String copy logic in one line.
Answers were Sorted based on User's Feedback
Answer / jitendra
void cpy_user(char *s, char *t)
{
while ((*s++ = *t++) != '\0');
}
Is This Answer Correct ? | 7 Yes | 7 No |
Answer / anurag
SORRY !!!
The last posted Ans. is for reverse of the string in one
line...by mistake it has been posted in this.
Is This Answer Correct ? | 4 Yes | 5 No |
Answer / anurag
int i=0,len=strlen(str);
int j=len/2;len--;
while(i<j)
{
*(str+i)^=*(str+len)^=*(str+i)^=*(str+len);
len--;i++;
}
Is This Answer Correct ? | 4 Yes | 7 No |
Answer / vijay
strpy(n1,n2)
here copy of string n2 in string n1
Is This Answer Correct ? | 12 Yes | 24 No |
Write a program to check whether the number is prime and also check if it there i n fibonacci series, then return true otherwise return false
#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }
How can I Create a C program in splitting set of characters to specific subsets. Example: INPUT SET OF CHARACTERS: Therefore, my dear brothers and sisters, stand firm. Let nothing move you. Always give yourselves fully to the work of the Lord, because you know that your labor in the Lord is not in vain. SPLIT INTO HOW MANY CHARACTERS PER SUBSETS: 10 OUTPUT: Therefore, my dear b rothers an d sisters, stand fir m. Let not hing move you. Alway s give you rselves fu lly to the work of t he Lord, b ecause you know that your labo r in the L ord is not in vain.
void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(ā%dā, i); }
Write a program that produces these three columns sequence nos. using loop statement Sequence nos. Squared Squared + 5 1 1 6 2 4 9 3 9 14 4 16 21 5 25 30
main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }
write a program to Insert in a sorted list
void main() { void *v; int integer=2; int *i=&integer; v=i; printf("%d",(int*)*v); }
Write a program to model an exploding firecracker in the xy plane using a particle system
main() { int i=5; printf(ā%dā,i=++i ==6); }
main() { int i=300; char *ptr = &i; *++ptr=2; printf("%d",i); }
Is the following statement a declaration/definition. Find what does it mean? int (*x)[10];