Ad Code

Ticker

6/recent/ticker-posts

Coronavirus Prank program Using C -oklesson

If you have any knowledge about C language, then this post of today is for you. In today's post discuss about "Coronavirus parnk program using C". you will learn how to make a Corona Testing Program. However, this program is for entertainment only. With this you cannot accurately ascertain whether a person has corona virus or not. In this program we have only used the switch. People who have a C language know how to use the switch in C language.


We use the switch when we have to excute only one condition in many conditions. We can also do this work with the help of nested if else. But using nested If else, the code becomes a bit bigger and a lot of people do not even understand what has happened in this program and what does not. The syntax of the switch is very simple.
Example:--
 switch( expression/Variable)
{
case 1:
printf(" hello world");
break;
case 2:
printf("what is your name");
break;
case 3:
printf("stay home");
break;
default: printf(" your expression in not matched");
}
Above is a small example. Regarding the switch statement, we write an expression in the parenthesis of the switch, that expression can also be a variable when the value of an expression or variable matches a case. So it runs the printf inside the same case, and if no value matches, then the printf inside the default runs.

For example, if the value of a variable is 2, you will see its answer through printf "what is your name".
Using a switch is very simple. You can also make a calculator using it. In today's program, we have only used the switch and made a "coronavirus prank program using C". You can run more than one switch in a program, there is no limit. So let's see how we can create a Prank Corona Testing Program using the switch statement.
Also Read:--- Introduction of C programming

Corona Prank Program

/* Corona Testing Program using C programming */
/*include header file */
#include<stdio.h>/* some code editor is not support this library file you remove it */
#include<conio.h>
main()
{
int a,b ;
clrscr(); /* clear screen */
/*add color code on C programming*/
printf(" \033[32;1;5m Choose one option of this menu (only menu number )");
printf("\n 1.Do you have fever ?\n 2.Do you have cough ?\n 3.Do you have trouble breathing ?\n 4.Do you have head and joint pain ?\n");
scanf("%d",&a);
switch(a) /* you can use a variable*/
{
case 1: /* you use only colon not semi colon*/
 printf(" \nDon't worry | Your report is processing.........  ");
break;
case 2:
printf(" Take medicine | Your report is processing........ ");
break;
case 3:
printf(" check your health on Aarogya setu App | Your report is processing....... ");
break;
case 4:
printf("You need to blood test | Your report is processing....... ");
break;
default: printf(" Your option is not matched ");
}
printf(" Choose another option above menu");
scanf("%d",&b);
switch(b)
{
case 1:
printf(" Your report is come | You are not infected with coronavirus  ");
break;
case 2:
printf(" Your report is come | you have 40 percent chance to infected with coronavirus ");
break;
case 3:
printf(" Your report is Come | you need to 14 days isolation          ");
break;
case 4:
printf("Your report is come | Stay home otherwise you infected with coronaviruse  ");
break;
default: printf(" your option is not matched ");
}
getch();
}
This is a small program to prank, if there is any error in your program then you can contact us on our E-mail. In this program "Coronavirus prank program using C" we have used two switches and each switch has 4 conditions and one default condition. If the value of the variable given by the user does not match any of these conditions, then the default printf will run. By which the user will get a message that the value he has entered is not correct.Below you will find a short video of this program, with the help of which you will understand how this program works.

If you like both this program and the post, then you will definitely let us know by commenting. And if you have any other idea to improve this program, then you definitely tell us, soon you will get Whatsapp support on this blog with the help of which you can contact anytime, if you feel that this post Anyone  can be useful, so you must share it. Thank you |

Disclaimer :-- The program mentioned in this post is made from entertainment purpose only. It does not confirm the corona infection of any person. Please do not take it seriously. The purpose of this post is not to offend anyone. We hope that you guys will be fine. For more information, you should download aarogya setu app. Stay safe at home

Post a Comment

0 Comments