Category: C programming

python tutorials and learn python

Created with Sketch.

C program to delete a file

  C program to delete a file C program to delete a file whose name (with extension) a user will input. The file must be present in the directory in which the executable of this program is present. Macro “remove” is used to delete the file. If there is an error in deleting the file,…
Read more

C program to generate random numbers

  C program to generate random numbers C program to generate pseudo-random numbers using rand and random function (Turbo C compiler only). As the random numbers are generated by an algorithm used in a function they are pseudo-random, this is the reason that word pseudo is used. Function rand() returns a pseudo-random number between 0…
Read more

C program to add two complex numbers

  C program to add two complex numbers C program to add two complex numbers: this program performs the addition of two complex numbers which will be entered by a user and then prints it. A user inputs real and imaginary parts of two complex numbers. In our program we will add real parts and…
Read more

C program to print date

  C program to print date C program to print current system date. To print date, we will use getdate function. C programming code (Works in Turbo C only) #include <stdio.h> #include <conio.h> #include <dos.h> int main() { struct date d; getdate(&d); printf(“Current system date: %d/%d/%d”, d.da_day, d.da_mon, d.da_year); getch(); return 0; } This code…
Read more

C program to get IP address

  C program to get IP address C program to print IP (Internet Protocol) address of your computer, system function is used to execute the command “ipconfig” which prints IP address, subnet mask, and default gateway. The code given below works for Windows XP and Windows 7. If you are using Turbo C compiler then…
Read more

C program to shut down or turn off the computer

  C program to shut down or turn off the computer C program to shut down your computer, i.e., to turn off a computer system. System function of “stdlib.h” is used to run an executable file “shutdown.exe” which is present in C:\WINDOWS\system32 folder in Windows 7 & XP. See Windows XP and Linux programs at…
Read more

C programming

  C programming C programming language: To easily learn C language you must start making programs in it. As you may already know that to develop programs you need a text editor and a compiler to translate a source program into machine code which can be executed directly on a machine. Dev C++ IDE is…
Read more