void main(void)
{
system(“shutdown -s”);
}
Save the above .Let file name is close.c and compile and execute the above program. Now close the turbo c compiler and open the directory in window you have saved the close.c (default directory c:tcbin) and double click its exe file (close.exe).After some time your window will shutdown.
2. Write a scanf statement which can store one line of string which includes white space?
Answer:
void main() {
char a[30];
clrscr();
scanf(“%[^n]”,a);
printf(“%s”,a);
getch();
}
3. Given the string “MATCHMAKING”, write a program to read the string from the terminal and display the same in the following formats:
(a) MATCH MAKING
(b) MATCH
MAKING
(c) M.M.
4. I need it to write a C/C++ program that connects to a MySQL server and displays the global TIMEZONE.
5. A string (example “I am writing an email”) is entered through the keyboard, write a program in C to get its reverse in a column as output i.e.:
email
an
writing
am
Answer:
void main()
{
char str[20];
char *ptr=str,*temp;
int i=0,j;
clrscr();
scanf(“%[^n]”,str);
while(*ptr){
i++;
ptr++;
}
for(j=0;j
if(*ptr==’ ‘)
{
temp=ptr;ptr–;temp++;
while((*temp!=’ ‘)&&(*temp!=’