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 |
#define a 10 void foo() { #undef a #define a 50 } int main() { printf("%d..",a); foo(); printf("%d..",a); return 0; } explain the answer
C program to print magic square of order n where n > 3 and n is odd
main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above
write a simple calculator c program to perform addition, subtraction, mul and div.
0 Answers United Healthcare, Virtusa,
main ( ) { static char *s[ ] = {“black”, “white”, “yellow”, “violet”}; char **ptr[ ] = {s+3, s+2, s+1, s}, ***p; p = ptr; **++p; printf(“%s”,*--*++p + 3); }
Program to Delete an element from a doubly linked list.
4 Answers College School Exams Tests, Infosys,
#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }
main() { clrscr(); } clrscr();
#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }
main() { int i=-1; -i; printf("i = %d, -i = %d \n",i,-i); }
const int perplexed = 2; #define perplexed 3 main() { #ifdef perplexed #undef perplexed #define perplexed 4 #endif printf("%d",perplexed); } a. 0 b. 2 c. 4 d. none of the above
main() { int i=10,j=20; j = i, j?(i,j)?i:j:j; printf("%d %d",i,j); }