C statement to copy a string without using loop and library
function..
Answers were Sorted based on User's Feedback
Answer / abhishek soni
main(){
char ch[10]="Welcome";
char copy[10];
int i=0;
clrscr();
copyStr:
copy[i] = ch[i++];
if(ch[i] != '\0')
goto copyStr;
printf("%s",copy);
getch();
}
Is This Answer Correct ? | 72 Yes | 8 No |
Answer / goresh
main()
{
char str1[]="My name is Goresh...";
char *p;
p=str1;
printf("%s",p);
}
Is This Answer Correct ? | 28 Yes | 13 No |
void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %d\n",++i); }
char inputString[100] = {0}; To get string input from the keyboard which one of the following is better? 1) gets(inputString) 2) fgets(inputString, sizeof(inputString), fp)
main() { char name[10],s[12]; scanf(" \"%[^\"]\"",s); } How scanf will execute?
void main() { static int i=i++, j=j++, k=k++; printf(āi = %d j = %d k = %dā, i, j, k); }
void main() { int i=5; printf("%d",i++ + ++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() { extern int i; i=20; printf("%d",sizeof(i)); }
main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }
pls anyone can help me to write a code to print the values in words for any value.Example:1034 to print as "one thousand and thirty four only"
void main() { int i=i++,j=j++,k=k++; printf(ā%d%d%dā,i,j,k); }
Cluster head selection in Wireless Sensor Network using C programming language.
/*what is the output for*/ void main() { int r; printf("Naveen"); r=printf(); getch(); }