0
How to print multiple data if set condition
a[]={1,2,3,4,5,6,7,8,9} How can I write a programme that will display data value below 5. meaning output will print 1,2,3,4,5 in C language
1 Réponse
0
You can just write a loop and use an if clause inside of it, to check if the value is smaller than 5.
for (int i = 0; I < sizeof(a)/sizeof(a[0]); i++) {
if (a[i] < 6)
printf("%d", a[i]);
}