What is the output of the following code#include stdio.hint main() {int a[] = {1, 2, 3, 4};int sum = 0;for(int i = 0; i 4; i++) {sum += a[i];}printf("%d", sum);return 0;
#include stdio.hEnter a string: sookshmasint main() {char str[1000], ch;int count = 0;printf("Enter a string: ");fgets(str, sizeof(str), stdin);printf("Enter a character to find its frequency: ");scanf("%c", &ch);for (int i = 0; str[i] != '\0'; ++i) {if (ch == str[i])++count;}printf("Frequency of %c = %d", ch, count);return 0;}
#include stdio.h#define VAL 3 * (2 + 6)void solve() {int a = 10 + VAL;printf("%d", a);}int main() {solve();return 0;}
#includestdio.hint main(){int x=2, y=2;for(; y; printf("%d %d\n", x, y)){y = x++ = 5;}printf("\n");return 0;}