main()
{
int y;
scanf("%d",&y); // input given is 2000
if( (y%4==0 && y%100 != 0) || y%100 == 0 )
printf("%d is a leap year");
else
printf("%d is not a leap year");
}
Answer / susie
Answer :
2000 is a leap year
Explanation:
An ordinary program to check if leap year or not.
| Is This Answer Correct ? | 4 Yes | 0 No |
how to swap 3 nos without using temporary variable
void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %d\n",++i); }
why do you use macros? Explain a situation where you had to incorporate macros in your proc report? use a simple instream data example with code ?
Which version do you prefer of the following two, 1) printf(ā%sā,str); // or the more curt one 2) printf(str);
main() { int i=10; void pascal f(int,int,int); f(i++,i++,i++); printf(" %d",i); } void pascal f(integer :i,integer:j,integer :k) { write(i,j,k); }
C statement to copy a string without using loop and library function..
main() { int (*functable[2])(char *format, ...) ={printf, scanf}; int i = 100; (*functable[0])("%d", i); (*functable[1])("%d", i); (*functable[1])("%d", i); (*functable[0])("%d", &i); } a. 100, Runtime error. b. 100, Random number, Random number, Random number. c. Compile error d. 100, Random number
main() { int i=10; i=!i>14; Printf ("i=%d",i); }
‎#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }
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
#define max 5 #define int arr1[max] main() { typedef char arr2[max]; arr1 list={0,1,2,3,4}; arr2 name="name"; printf("%d %s",list[0],name); }
Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange