#include <conio.
h>
#include<stdio.h>
int main()
{
int day;
puts("enter day 1-7\n");
scanf_s("%d",&day);
switch (day)
{
case 1:
printf("monday\n");
break;
case 2:
printf("tuesday\n");
break;
case 3:
printf("wednesday\n");
break;
case 4:
printf("thursday\n");
break;
case 5:
printf("friday\n");
break;
case 6:
printf("saturday\n");
break;
case 7:
printf("sunday\n");
break;
}
getch();
return 0;
}
ACTIVITY:
# include<conio.h>
#include<stdio.h>
int main()
{
int age,marks;
float height;
printf("age of player\n");
scanf("%d",age);
if(age>16||age<20)
printf("age level is passed\n");
printf("height of player\n");
scanf("%f",height);
if(height==5.6)
printf("player passed");
printf("marks of player\n");
scanf("%d",marks);
if(marks>=60)
printf("student is passed\n");
else
printf("player is fail");
getch();
return 0;
}
ACTIVITY:
# include<conio.h>
#include<stdio.h>
int main()
{
int age,marks;
float height;
printf("age of player\n");
scanf("%d",age);
printf("height of player\n");
scanf("%f",height);
printf("marks of player\n");
scanf("%d",marks);
if (age>=16&&height==5.6&&marks>60)
printf("student is passed\n");
else
printf("player is fail");
getch();
return 0;
}
ACTIVITY:
#include<stdio.h>
#include<conio.h>
int main(){
int n,i;
int sum=0;
printf("Enter the n\n");
scanf("%d",&n);
sum = (n * (n + 1)) / 2;
printf("Sum of the numbers\n ");
for(i =1;i <= n;i++)
{
if (i!=n)
printf("%d ",i);
else
printf("%d = %d ",i,sum);
}
getch();
return 0;
}