#include stdio.hGuess the output?int main() {int year = 2024;int sundays = 0;for (int month = 1; month = 12; month++) {int days = 31;if (month == 4 || month == 6 || month == 9 || month == 11) {days = 30;} else if (month == 2) {if (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)) {days = 29;} else {days = 28;}}for (int day = 1; day = days; day++) {if ((year - 1) % 4 == 0 && ((year - 1) % 100 != 0 || (year - 1) % 400 == 0)) {int day_of_week = (365 + ((year - 1) / 4 - (year - 1) / 100 + (year - 1) / 400) + (31 * (month - 1)) - ((month 2) ? (4 * month + 23) / 10 : 0) + day) % 7;if (day_of_week == 0) {sundays++;}} else {int day_of_week = (365 + ((year - 1) / 4 - (year - 1) / 100 + (year - 1) / 400) + (31 * (month - 1)) - ((month 2) ? (4 * month + 23) / 10 : 0) + day + 1) % 7;if (day_of_week == 0) {sundays++;}}}}printf("There are %d Sundays in %d (a leap year).\n", sundays, year);return 0;}
#include stdio.hWhat is the output of the following program#define VAL 3 * (2 + 6)void solve() {int a = 10 + VAL;printf("%d", a);}int main() {solve();return 0;}
public class abc{int a=2000;public static void main(String argv[]){System.out.println(argv[1]+" :-Please pay Rs."+a);}}
public class Main {public static void solve() {int first = 10, second = 20;int third = first + second;{int third = second - first;System.out.printf("%d ", third);}System.out.printf("%d", third);throw new RuntimeException("Something went wrong!");}public static void main(String[] args) {try {solve();} catch (Exception e) {System.err.println("Exception occurred: " + e.getMessage());}}}
#includestdio.hint main() {int intType;float floatType;double doubleType;char charType;printf("Size of int: %zu bytes\n", sizeof(intType));printf("Size of float: %zu bytes\n", sizeof(floatType));printf("Size of double: %zu bytes\n", sizeof(doubleType));printf("Size of char: %zu byte\n", sizeof(charType));return 0;}
#include stdio.hvoid solve() {int x = 2;printf("%d", (x 1) + (x 1));}int main() {solve();return 0;}
class Output{public static void main(String args[]){double x = 2.0;double y = 3.0;double z = Math.pow( x, y );System.out.print(z);}}