C++ Programming Practice Part-02
#include <stdio.h>
main()
{
int dec = 5;
char str[] = “abc”;
char ch = ‘s’;
float pi = 3.1416;
printf (“%d %s %f %c\n”, dec, str, pi, ch);
}
#include<stdio.h>
#include<conio.h>
int main ( )
{
int year;
printf(“Enter year”);
scanf(“%d”,& year);
if (year % 400==0)
printf(“%d is Leap Year”,year);
else if (year %100 == 0)
printf(“%d is not Leap Year”,year);
else if (year %4 == 0)
printf(“%d is Leap Year”,year);
else
printf(“%d is Leap Year”,year);
getch ( );
return 0;
}
Leave a Reply