C syntax

0.0(0)
studied byStudied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/25

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 7:16 AM on 11/25/25
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

26 Terms

1
New cards

#include <stdio.h>

if printf scanf is used

2
New cards

#include <math.h>

if sin cos sqrt is used

3
New cards

#include <string.h>

if strlen strcpy strcmp strcat is used

4
New cards

for loop

<p></p>
5
New cards

while loop

knowt flashcard image
6
New cards

do while loop

knowt flashcard image
7
New cards

printf

printf("My age is %d and Pi is %.2f\n", age, pi);

Output: My age is 30 and Pi is 3.14

8
New cards

scanf

scanf("%d", &number);

9
New cards

if else statements

knowt flashcard image
10
New cards

must declare and assign variables

<p></p>
11
New cards

#include <stdlib.h>

library to use system

12
New cards

#include <stdbool.h>

used if bool expressions

13
New cards

void main()

means the program does not send data back to the system

14
New cards

x==y

compare if they are equal

15
New cards

>= <=

greater than or equal
less than or equal

16
New cards

pre increment vs post increment

knowt flashcard image
17
New cards

ternary operator

Y=(4 < 5) ? (42) : (9) Y=42

Y=(2==3) ? (a) : (b) Y=b

18
New cards

if statement

if (x <= 10)

y = x * x + 5;

19
New cards

switch

switch (variable) {

case 1: // Code runs if variable == 1

break;

case 2: // Code runs if variable == 2

break;

default:

// Code runs if nothing matches }

20
New cards

#define MAX 100

The compiler never sees "MAX"; it only sees the number 100.

21
New cards

const int max = 100;

creates a variable named max, assigns it the value 100, and flags it as "read-only."

22
New cards

array

int scores[] = {85, 90, 78, 92};

23
New cards

2d array

knowt flashcard image
24
New cards

int Factorial (int n);

type of return value name of function type of argument

25
New cards

strcpy(string1,string2);

string 2 is copied onto string 1

26
New cards

int *p;

printf("%p\n", &myvar);

Explore top flashcards