📝 Added sandbox (code sketchbook)
This commit is contained in:
parent
b475595f7f
commit
b5daf18b1a
142 changed files with 100702 additions and 0 deletions
21
sandbox/assert.c
Normal file
21
sandbox/assert.c
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
/* https://www.tutorialspoint.com/c_standard_library/c_macro_assert.htm */
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main() {
|
||||
int a;
|
||||
char str[50];
|
||||
|
||||
printf("Enter an integer value: ");
|
||||
scanf("%d", &a);
|
||||
assert(a >= 10);
|
||||
printf("Integer entered is %d\n", a);
|
||||
|
||||
printf("Enter string: ");
|
||||
scanf("%s", str);
|
||||
assert(str != NULL);
|
||||
printf("String entered is: %s\n", str);
|
||||
|
||||
return(0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue