CSE Lab Report Final
CSE Lab Report Final
SL
Name of Experiments Page NO
NO
#include<stdio.h>
int main()
{
Printf(“This is my first C Program”);
return 0;
}
Output :
This is my first C Program.
Problem NO:02
Problem Name:
Problem NO:03
Problem Name :
Problem Name :
A C program to calculate a year is leap year or not.
Source Code :
#include<stdio.h>
int main()
{
int year;
printf("Enter the year\n");
scanf("%d",&year);
if((year%4==0&&year%100!=0)||(year%400==0))
{
printf("\n%d is a leap year",year);
}
else
{
printf("\n%d is not a leap year",year);
}
return 0;
}
Output :
Enter the year
2024
2024 is a leap year
Enter the year
2025
2025 is not a leap year
Problem NO:06
Problem Name :
A C program to calculate anumber is even or odd.
Source Code :
#include<stdio.h>
int main()
{
int num;
printf("Enter the number\n");
scanf("%d",&num);
if(num%2==0)
{
printf("\nThe number is even",num);
}
else
{
printf("\nThe number is odd",num);
}
return 0;
}
Output :
Enter the number
4
The number is even
Enter the number
5
The number is odd