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 |
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.
How we print the table of 2 using for loop in c programing?
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.
main() { int i=4,j=7; j = j || i++ && printf("YOU CAN"); printf("%d %d", i, j); }
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
void main() { char ch; for(ch=0;ch<=127;ch++) printf(ā%c %d \nā, ch, ch); }
void main() { int *i = 0x400; // i points to the address 400 *i = 0; // set the value of memory location pointed by i; }
how to programme using switch statements and fuctions, a programme that will output two even numbers, two odd numbers and two prime numbers of the users chioce.
0 Answers Mbarara University of Science and Technology,
which function is used to clear the buffer stream on gcc? for example: I wrote following code on gcc #include<stdio.h> int main(void) { char ch; int a,b; printf("\nenter two numbers:\t"); scanf("%d%d",&a,&b); printf("enter number is %d and %d",a,b); printf("\nentercharacter:\t"); scanf("%c",&ch); printf("enter character is %c",ch); return 0; } in above progarm ch could not be scan. why?plz tell me solution.
struct point { int x; int y; }; struct point origin,*pp; main() { pp=&origin; printf("origin is(%d%d)\n",(*pp).x,(*pp).y); printf("origin is (%d%d)\n",pp->x,pp->y); }
to remove the repeated cahracter from the given caracter array. i.e.., if the input is SSAD output should of SAD
can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail