What is C language: Definition and 27 Discussions

C (, as in the letter c) is a general-purpose, procedural computer programming language supporting structured programming, lexical variable scope, and recursion, with a static type system. By design, C provides constructs that map efficiently to typical machine instructions. It has found lasting use in applications previously coded in assembly language. Such applications include operating systems and various application software for computer architectures that range from supercomputers to PLCs and embedded systems.
A successor to the programming language B, C was originally developed at Bell Labs by Dennis Ritchie between 1972 and 1973 to construct utilities running on Unix. It was applied to re-implementing the kernel of the Unix operating system. During the 1980s, C gradually gained popularity. It has become one of the most widely used programming languages, with C compilers from various vendors available for the majority of existing computer architectures and operating systems. C has been standardized by the ANSI since 1989 (ANSI C) and by the International Organization for Standardization (ISO).
C is an imperative procedural language. It was designed to be compiled to provide low-level access to memory and language constructs that map efficiently to machine instructions, all with minimal runtime support. Despite its low-level capabilities, the language was designed to encourage cross-platform programming. A standards-compliant C program written with portability in mind can be compiled for a wide variety of computer platforms and operating systems with few changes to its source code.As of January 2021, C was ranked first in the TIOBE index, a measure of the popularity of programming languages, moving up from the no. 2 spot the previous year.

View More On Wikipedia.org
  1. C

    Why declarations in <stdio.h> aren't implemented?

    In the C programming language any .h file is a file that contains constants and/or function declarations ( but no implementations, besides inline functions ). That means that when I write #include <foo.h> at the start of my .c file, I'll have to implement all those function declarations (...
  2. M

    Comp Sci Interrupts on pic18f452 not shooting in mplab X, help? C language

    I am using MPLAB X, everything is working great when I work on examples that require smaller or no preload at all, I do not understand why that is the case, is there a limit to the TMR0L? Hello please help asap, my specific case I have: 4MHz crystal -----> 1 / (4MHz / 4) = 1MHz timer I...
  3. I

    Comp Sci C language "too many arguments for format" error

    I have a problem there,I want to Users decide a,b,c,d,e numbers. if I write printf("enter numbers:"); scanf("%d",&a); printf("enter numbers:"); scanf("%d",&b);... if ı do like that ,it has not any problem but its not effective,Program always asking number a,b,c etc. My wish is...
  4. A

    Comp Sci Do-while loop-> exit not working (making a crossword puzzle)

    Hello! My homework is making a crossword. I write a code like this: do{ //code printf("Please enter the coordinate and the word: \n"); scanf(" %c%d %s",&row2,&column2,word2); if(row2=='E' && word2=="xit") exit(0); //code }while(count2!=10); But this is...
  5. arcTomato

    Engineering The power spectrum of a sine wave (C language)

    Hi I would like to Derive the power spectrum of sinusoid.I tried like this. But It doesn't work. <Moderator: CODE tags added> #include <stdio.h> #include <math.h> #define pi 3.1415926535 FILE *in_file, *out_file; int main() { dft(); } int dft(int argc, char *argv[]) { char...
  6. toforfiltum

    Program to display letter combinations on phone keypad

    Homework Statement On a phone keypad, many of the numbers have letters associated with them. For instance, the letters A, B, and C are associated with the number 2. Write a program that accepts a number as input and prints all of the possible letter combinations associated with that number. For...
  7. sukalp

    C/C++ C++ Stack and Queue Tutorial for Beginners

    is there any tutorial which covers stack and queue in c++. i am not able to understand it is getting difficult for me .
  8. C

    MATLAB Is 2GB ram enough to work on C language and matlab

    Hello everyone I am going to buy a computer soon. And because I don't have much money, computer s ram can be 4 GB at most and which will cause me some trouble. My question is that will 2gb ram be enough to work on MATLAB and learning to code.
  9. Domenico94

    C/C++ C++ vs C Debugging: How Hard Is It?

    How hard is c++ debugging compared to c? What do you think o f the sentence: "It s easier to shoot your foot in c. In c++ it s harder, but when you do, you blow away your whole leg"? Is it really hard( considering the fact code isn t "context free" and it may vary from compiler to compiler, it s...
  10. Maged Saeed

    MHB What are the parameters for the printf function in the C language?

    As I know each function can have no parameter this function is called void function ,for example main function, also there is some functions which has one or more parameters either input or output , the number of parameters should be specified in the function prototype and function definition...
  11. K

    Why Does Changing Pointer Assignments in C Affect Variable Values?

    int main(void) { int *ptr; int a=1, b=2, c=3; ptr = &a; printf("%p\n", &ptr); printf("%p\n", &b); printf("%p\n", &c); ptr = b; printf("%p\n", ptr); printf("%d\n", a); system("PAUSE"); return 0; } ok here is the code I wrote. ptr(the...
  12. N

    C language: I cannot find the output file.

    What is wrong with my code? #include <stdio.h>int main(int argc, char *argv[]) { int i=0; FILE *fp; char fname[100]; sprintf(fname,"%04X.txt",i); fp=fopen("fname", "w"); fprintf(fp, "hello world!\n"); fclose(fp); }
  13. Z

    Reading .txt files to an array in C language

    I have a .txt file with 100,000 integers from 1-100,000, with each integer in a newline. I am facing a problem in using the fgets function. How do I read the integers into an array? #include <stdio.h> //Program to count number of inversions in an input file of integers using Brute force...
  14. pairofstrings

    Is it a valid statement - C language?

    Here is a part of a statement, it might be incorrect, I don't remember the exact statement. Please tell me what the double exclamation marks means and what about the double percentages. Here is the code. if (!(!d = %%d)) else ... ( not spot-on, don't remember) I think...
  15. pairofstrings

    How Does the Extern Keyword Work in C Language?

    Can you explain the working mechanism of extern keyword in C language? I have tried wiki and other sites but couldn't follow. Please explain in simple english.
  16. N

    C language: reading a txt file and segment fault

    I use gcc to compile the code. When I run the program, I get segmentation fault (core dumped). ranked_galaxies.txt: # PGC Name RA DEC Mass Distance Diameter Tile_Number Rank_stat 37617 NGC3992 179.399700 53.374450 2.290868 22.909000 5.613000 1 2.51796409431e-05 62964 IC4837A...
  17. N

    A little question about c language

    #include <stdio.h> #include <stdlib.h> int main() { double a[10]; int i=0; for(i=0;i<10;i++) a[i]=0.0; for(i=0;i<10;i++) printf("a[%d]=%e, "), i, a[i];} The result is radom number. What's wrong with my code?
  18. N

    A little question about c language

    /*find abs value of an array*/ int absv(double *a, int n) { int i; for(i=0;i<n;i++) {if (a[i]<0) a[i]=-a[i]; } } int main() { double a[7]; int i,j; for(i=0;i<7;i++) scanf("%lf\n",&a[i]); absv(a,7); for(j=0;j<7;j++) printf("%e\n",a[j]); printf("%d,%d",i,j); } The...
  19. M

    How can I fix syntax errors in my C code?

    Hi all, I am learning C language in S-Function Simulink does anyone prgram in C? I need help please Thanks
  20. D

    Electrical Engineering and have already learnt C language

    I am an student of Electrical Engineering and have already learned C language since, it is useful for programming of micro-controllers. I still want to learn some other programming language too. Please suggest me a programming language that will be useful for me for making useful softwares and...
  21. V

    Compare execution time in C language

    Homework Statement I want to compare the execution times for DDA and Bresenham's Line algorithm using a C program. I used the clock_t command; I'm getting the execution time for Bresenham’s algorithm as 0.164835 but 0 for DDA. 3. The Attempt at a Solution clock_t start,end...
  22. H

    Q: how variable declaration & initializing in C Language.

    hi please tell me how variable declaration & initializing in C Language..whit examples..
  23. R

    C Language Problem: Arithmetic & Fileread() Function

    Homework Statement 1Can we perform arithmetic operations between float and int variables , As an example can we say a+b while a is an integer and b is a float. 2 And what function below will read NUMBER of elements from a file? fileread( ) getline( ) readfile( ) fread( )...
  24. K

    What is the impact of using the void keyword before the main function in C?

    What is the effect of putting void before main function i mean? void main() { } void main(void) { }
  25. P

    Matrix operations in C language

    i have a matrix 4x4 like this 1 5 7 3 2 6 8 0 1 4 3 2 0 4 0 5 my teacher asks me to print out 1 2 3 4 each of the digits is from the 1st 2nd 3rd 4th rows it looks very simple, but because i just learned c for two months, i don't know how to code a program, true. could you help me...
  26. Y

    Coding Help: Numerical Methods in C Language

    a "C" problem is anybody aware of numerical methods in C language... numerical methods include Newton-Raphson method,Euler's method,Milne's method,Newton's forward and backward implementation,Gauss divergence backward and forward interpolation. pls help me,i will b so thankful 2 them who...
  27. K

    Any good programming challenge using the c language.

    I am currently in my second quarter learning the c language. The class is not hard at all, but i want some challenge problems. Are there any goods links?