Prgrms For Unit-I
Prgrms For Unit-I
#include <stdio.h>
int main() {
float length, width, area, perimeter;
return 0;
}
return 0;
}
Program: Day of the Week
#include <stdio.h>
int main() {
int day;
return 0;
}
return 0;
}
// Calculate sum of even numbers between 1 and 100 using a while loop
while (i <= 100) {
if (i % 2 == 0) {
sum += i;
}
i++;
}
return 0;
}
return 0;
}
Program: Count Positive, Negative, and Zero Numbers
#include <stdio.h>
int main() {
int num, positiveCount = 0, negativeCount = 0, zeroCount = 0;
if (num == -1)
break;
if (num > 0)
positiveCount++;
else if (num < 0)
negativeCount++;
else
zeroCount++;
}
return 0;
}