Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- scanf



  Read white space with scanf()

Usually, when we want to enter string with white spaces in C, we need to call gets() or fgets(0 method. We usually will not use scanf(0 or fscanf() because they cannot accept white spaces when scan user inputs.   But when we specify the format in scanf() function, we may read strings with white space. the code section below illustrate this: #include <stdio.h>   int main(int argc,char **argv){        char name[30];      fprintf(stdout,"Please en...

   C,scanf,white space, string format     2011-09-26 11:45:43

  C program to shutdown or turn off computer

C Program to shutdown your computer :- This program turn off i.e shutdown your computer system. Firstly it will asks you to shutdown your computer if you press 'y' the your computer will shutdown in 30 seconds, system function of "stdlib.h" is used to run an executable file shutdown.exe which is present in C:\WINDOWS\system32 in windows-xp. You can use various options while executing shutdown.exe for example -s option shutdown the computer after 30 seconds, if you wish to shutdown immediately th...

   C,Windows,Shutdown,Command,Code     2011-10-10 07:08:31