Display the time of the system and display the right time
of the other country
Answer / ln007
Program to read the current date and time
#include<time.h>
main()
{
struct tm *k;
unsigned long int t;
int h,m,s;
int dd,mm,yy;
t = time(0);
k = localtime(&t);
h = k->tm_hour;
m = k->tm_min;
s = k->tm_sec;
dd = k->tm_mday;
mm = k->tm_mon+1;
yy = k->tm_year+1900;
printf("Time : %d : %d : %d\n",h,m,s);
printf("Date : %d : %d : %d\n",dd,mm,yy);
}
Is This Answer Correct ? | 0 Yes | 1 No |
Finding a number multiplication of 8 with out using arithmetic operator
What is the output for the following program main() { int arr2D[3][3]; printf("%d\n", ((arr2D==* arr2D)&&(* arr2D == arr2D[0])) ); }
main() { int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m); }
Given a spherical surface, write bump-mapping procedure to generate the bumpy surface of an orange
void main() { static int i=i++, j=j++, k=k++; printf(“i = %d j = %d k = %d”, i, j, k); }
main() { int i=5; printf("%d",++i++); }
main() { char *cptr,c; void *vptr,v; c=10; v=0; cptr=&c; vptr=&v; printf("%c%v",c,v); }
What is full form of PEPSI
main() { clrscr(); } clrscr();
main() { 41printf("%p",main); }8
Write a routine to implement the polymarker function
main() { int i; float *pf; pf = (float *)&i; *pf = 100.00; printf("\n %d", i); } a. Runtime error. b. 100 c. Some Integer not 100 d. None of the above