#define clrscr() 100
main()
{
clrscr();
printf("%d\n",clrscr());
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
100
Explanation:
Preprocessor executes as a seperate pass before
the execution of the compiler. So textual replacement of
clrscr() to 100 occurs.The input program to compiler looks
like this :
main()
{
100;
printf("%d\n",100);
}
Note:
100; is an executable statement but with no
action. So it doesn't give any problem
Is This Answer Correct ? | 44 Yes | 2 No |
Answer / naveen
yes it works and prints 100 because we defined clrscr() to
100. we can also set values to any predefined functions
Is This Answer Correct ? | 20 Yes | 1 No |
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); }
int DIM(int array[]) { return sizeof(array)/sizeof(int ); } main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr)); }
How to count a sum, when the numbers are read from stdin and stored into a structure?
Write a C program to print look and say sequence? For example if u get the input as 1 then the sequence is 11 21 1211 111221 312211 12112221 .......(it counts the no. of 1s,2s etc which is in successive order) and this sequence is used in run-length encoding.
main() { int x=5; clrscr(); for(;x==0;x--) { printf("x=%d\n”", x--); } } a. 4, 3, 2, 1, 0 b. 1, 2, 3, 4, 5 c. 0, 1, 2, 3, 4 d. none of the above
main(int argc, char **argv) { printf("enter the character"); getchar(); sum(argv[1],argv[2]); } sum(num1,num2) int num1,num2; { return num1+num2; }
main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }
Design an implement of the inputs functions for event mode
main() { char a[4]="HELLO"; printf("%s",a); }
Program to find the largest sum of contiguous integers in the array. O(n)
int swap(int *a,int *b) { *a=*a+*b;*b=*a-*b;*a=*a-*b; } main() { int x=10,y=20; swap(&x,&y); printf("x= %d y = %d\n",x,y); }
main() { int k=1; printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE"); }