#include <stdio.h>
#pragma warning(disable:4996)
int main(void) {
int arr[10];
int input, k;
printf("input 10 numbers : \n");
for (k = 0; k < 10; k++)
scanf("%d", &arr[k]);
printf("\ninput number to find : \n");
scanf("%d", &input);
for (k = 0; k < 10; k++)
if (arr[k] == input) break;
if (k == 10) printf("The number %d not found\n", input);
else printf("The number %d is found at %dth index of array\n", input, k);
return 0;
}
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
#include <stdio.h>
int main(void) {
int i, j;
char c;
for (i = 0; i < 9; i++) {
for (j = 0; j < 19; j++) {
if (i % 2 == j % 2) c = '*';
else c = ' ';
printf("%c", c);
}
printf("\n");
}
return 0;
}
* * * * * * * * * * * *** * * * *** * * ***** * * ***** * ******* * ******* ********* ********* ******* * ******* * ***** * * ***** * * *** * * * *** * * * * * * * * * * *
#include <stdio.h>
int main(void) {
int i, j;
char c;
for (i = 0; i < 9; i++) {
for (j = 0; j < 19; j++) {
if (i % 2 == j % 2) c = '*';
else c = ' ';
if (i < 5) {
if (j >= 4 - i && j < 5 + i) c = '*';
if (j >= 14 - i && j < 15 + i) c = '*';
}
else {
if (j >= i - 4 && j < 12 - i) c = '*';
if (j >= i + 6 && j < 22 - i) c = '*';
}
printf("%c", c);
}
printf("\n");
}
return 0;
}
* * ***** ** * **** *** * *** **** * ** ***** * *
****** ****** **** ** ***** ** ****** ** ********** ** ****** ** **** ** **** ****** ******
****** ******
** **
** ****** **
** **
** ****** **
** **
****** ******
****************************
**
************************ **
** ** **
** **************** ** **
** ** ** ** **
** ** ******** ** ** **
** ** ** ** ** ** **
** ** ** **** ** ** **
** ** ** ** ** **
** ** ************ ** **
** ** ** **
** ******************** **
** **
****************************