Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first contri #31

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 134 additions & 0 deletions digitalno.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
#include<stdio.h>
int main (){
int h;
printf("enter the value of clock you want to print-");
scanf("%d",&h);
switch (h)
{
case 1:
for(int i=1;i<=7;i++){
for(int j=1;j<=4;j++)
{
if(j==4)
printf("*");
else
printf(" ");
}
printf("\n");
}
break;
case 2:
for(int i=1;i<=7;i++){
for(int j=1;j<=4;j++)
{
if(i==1||i==4||j==4&&i<5||j==1&&i>=4||i==7)
printf("*");
else
printf(" ");
}
printf("\n");
}
break;
case 3:
for(int i=1;i<=7;i++){
for(int j=1;j<=4;j++)
{
if(i==1||i==4||j==4||i==7)
printf("*");
else
printf(" ");
}
printf("\n");
}
break;
case 4:
for(int i=1;i<=7;i++){
for(int j=1;j<=4;j++)
{
if(i==4||j==4||j==1&&i<=4)
printf("*");
else
printf(" ");
}
printf("\n");
}
break;
case 5:
for(int i=1;i<=7;i++){
for(int j=1;j<=4;j++)
{
if(i==1||i==4||j==4&&i>=4||j==1&&i<=4||i==7)
printf("*");
else
printf(" ");
}
printf("\n");
}
break;
case 6:
for(int i=1;i<=7;i++){
for(int j=1;j<=4;j++)
{
if(i==1||i==4||i==7||j==1||j==4&&i>=4)
printf("*");
else
printf(" ");
}
printf("\n");
}
break;
case 7:
for(int i=1;i<=7;i++){
for(int j=1;j<=4;j++)
{
if(i==1||j==4)
printf("*");
else
printf(" ");
}
printf("\n");
}
break;
case 8:
for(int i=1;i<=7;i++){
for(int j=1;j<=4;j++)
{
if(i==1||i==4||i==7||j==1||j==4)
printf("*");
else
printf(" ");
}
printf("\n");
}
break;
case 9:
for(int i=1;i<=7;i++){
for(int j=1;j<=4;j++)
{
if(i==1||i==4||i==7||j==1&&i<=4||j==4)
printf("*");
else
printf(" ");
}
printf("\n");
}
break;

case 0:
for(int i=1;i<=7;i++){
for(int j=1;j<=4;j++)
{
if(i==1||i==7||j==1||j==4)
printf("*");
else
printf(" ");
}
printf("\n");
}
break;

default: printf("enter the value from 0 to 9 only");
break;
}
return 0;
}