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 |
main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }
#include<conio.h> main() { int x,y=2,z,a; if(x=y%2) z=2; a=2; printf("%d %d ",z,x); }
posted by surbhi just now main() { float a = 5.375; char *p; int i; p=(char*)&a; for(i=0;i<=3;i++) printf("%02x",(unsigned char) p[i]); } how is the output of this program is :: 0000ac40 please let me know y this output has come
#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); }
Write a single line c expression to delete a,b,c from aabbcc
Write out a function that prints out all the permutations of a string. For example, abc would give you abc, acb, bac, bca, cab, cba. You can assume that all the characters will be unique.
5 Answers IITR, Microsoft, Nike,
write a program in c language to get the value of arroy keys pressed and display the message which arrow key is pressed?
#include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s=malloc(sizeof(struct xx)); printf("%d",s->x); printf("%s",s->name); }
why the range of an unsigned integer is double almost than the signed integer.
main() { int i=10; i=!i>14; Printf ("i=%d",i); }
How to use power function under linux environment.eg : for(i=1;i<=n;i++){ pow(-1,i-1)} since it alerts undefined reference to 'pow'.
main() { unsigned int i=10; while(i-->=0) printf("%u ",i); }