#include stdio.hThe output of the code :-void solve() {int a[] = {1, 2, 3, 4, 5};int sum = 0;for(int i = 0; i 5; i++) {if(i % 2 == 0) {sum += *(a + i);}else {sum -= *(a + i);}}printf("%d", sum);}int main() {solve();return 0;}
main(){char x [10], *ptr = x;scanf ("%s", x);change(&x[4]);}change(char a[]){puts(a);}
#include stdio.hint main(){float x = 21.0;x %= 3.0;printf("%f",x);return 0;}
What will be the output of the following C code?#include stdio.hint main(){char *p = NULL;char *q = 0;if (p)printf(" p ");elseprintf("nullp");if (q)printf("q\n");elseprintf(" nullq\n");}
#include stdio.hvoid solve() {int a[] = {1, 2, 3, 4, 5};int sum = 0;for(int i = 0; i 5; i++) {if(i % 2 == 0) {sum += *(a + i);}else {sum -= *(a + i);}}printf("%d", sum);}int main() {solve();return 0;}