Write a single line c expression to delete a,b,c from aabbcc
Answers were Sorted based on User's Feedback
Answer / shirley
in arrays:
char a[6]="aabbcc";
for(i=0;i<3;i+=2)
a[i]=a[i+2];
a[i+1]='\0';
using pointers:
*s="aabbcc"
for(i=0;i<3;i++)
*(s+i)=*(s+i+2);
*(s+i+1)='\0';
Is This Answer Correct ? | 10 Yes | 7 No |
Answer / arihant jain
printf("%s\b\b\b\b\b\b \b\b\b\b\b\babc","aabbcc");
Is This Answer Correct ? | 5 Yes | 2 No |
main() { int i=5; printf(“%d”,i=++i ==6); }
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() { char name[10],s[12]; scanf(" \"%[^\"]\"",s); } How scanf will execute?
#define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); }
Write a program to print a square of size 5 by using the character S.
respected sir, i did my MCA in 2013 when i am going to attend to an interview i was asked about my project how will i explain my project could please help me in this and my project title is "Social Networking Site For Social Responsibility"
main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); } int i;
main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }
29 Answers IBM, TCS, UGC NET, Wipro,
main() { char p[ ]="%d\n"; p[1] = 'c'; printf(p,65); }
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); }
#include <stdio.h> #define a 10 main() { #define a 50 printf("%d",a); }
main() { char *cptr,c; void *vptr,v; c=10; v=0; cptr=&c; vptr=&v; printf("%c%v",c,v); }