HelpMeOutAlways: C Programs- Switch Case
Showing posts with label C Programs- Switch Case. Show all posts
Showing posts with label C Programs- Switch Case. Show all posts

Saturday, August 25, 2018

C programming by Tutorial Point Pdf

Sunday, June 24, 2018

C Program Simple Calculator Using Switch Case(switch case example)
June 24, 20180 Comments
#include<stdio.h> main () {   int menu, add, sub, mult, quit, num1, num2;   float dvd,Num1,Num2;// Here Num1 and Num2 is declared for Division operaion   printf ("=======================================\n");   printf ("Simple Calculator for Addition And Subtraction");   printf ("=======================================\n");   printf ("1.Add\n");   printf ("2.Sub\n");   printf ("3.Multiplication\n");  ...
Reading Time:
3 Min

Friday, June 22, 2018

C program Simple Calculator Of Addition or Subtraction using Switch Case
June 22, 20180 Comments
Source Code #include<stdio.h> int main () {   int menu, add, sub, quit, num1, num2;   printf ("======================================================\n");   printf ("Simple Calculator for Addition And Subtraction");   printf ("======================================================\n");   printf ("1.Add\n");   printf ("2.Sub\n");   printf ("3.Quit\n");   printf ("Please Select what do you want?\n");  ...
Reading Time:
3 Min
C Switch Case Program (What Do You Want to Drink?) Simple Example for bignners
June 22, 20180 Comments
Source Code #include<stdio.h> main () {   int drink;   printf ("Hello!Sir\n");   printf ("What would you like to drink?\n");   printf ("1.Tea\n");   printf ("2. Coffe\n");   printf ("Please Select (1/2):\n");   scanf ("%d", &drink);   switch (drink)     {     case 1:       printf ("Tea! ok Sir, i will be right back ", drink);       break;  ...
Reading Time:
3 Min

Friday, June 15, 2018

C Program To Check The Number Whether It Is Even or Odd( Switch Case)
June 15, 20180 Comments
#include<stdio.h> main() { int num; printf("Enter Any Integer\n"); scanf("%d",&num); switch(num%2) { case 0: printf("%d is Even Number",num); break; case 1: printf("%d is Odd Number",num); break; } return 0; } Output: ...
Reading Time:
3 Min
C Program To Check Whether It Is Leap Year Or Common Year (Switch Case)
June 15, 20180 Comments
// C program to check whether it is leap or common year #include<stdio.h> main() { int year; printf("Enter Year:\n"); scanf("%d",&year); switch(num%4==0&&num%100!=0||num%400==0) { case 1: printf("Leap Year"); break; default: printf("common year"); } return 0; } Output ...
Reading Time:
3 Min

Wednesday, June 13, 2018

C Program To Check Whether it Is Vowel or Constant (Switch Case Example)
June 13, 20180 Comments
//Write a C program TO chEck WheatHer It iS VoWel Or CoNsTant #include<stdio.h> main() { char ch; printf("Enter any character:\n"); scanf("%c",&ch); switch(ch) { case 'a': case 'A' : printf("Its VOwel Baby!"); break; case 'e': case 'E' : printf("Its VOwel Baby!"); break; case 'i': case 'I' : printf("Its VOwel Baby!"); break; case 'o': case 'O' : printf("Its VOwel Baby!"); break; case 'u': case 'U'...
Reading Time:
3 Min
Check Whether The Number Is Positive, Negative Or Zero With Switch Statement
June 13, 20180 Comments
#include<stdio.h> main() { int num; printf("Enter any Number To Check It is Positive or Negative:\n"); scanf("%d",&num); switch(num>0) { case 1: printf("%d is positive number",num); break; case 0: switch(num<0) { case 1: printf("%d is negative number",num); break; case 0: printf("%d is zero",num); break; } break; } return 0; } ...
Reading Time:
3 Min
Switch Program To Print A Week (example switch ) In C
June 13, 20180 Comments
#include<stdio.h> main() { int week; printf("Enter any Number To Print Week day (1-7):\n"); scanf("%d",&week); switch(week) { case 1: printf("Its Monday"); break; case 2: printf("Its Tuesday"); break; case 3: printf("Its Wednesday"); break; case 4: printf("Its Thursday"); break; case 5: printf("Its Friday"); break; case 6: printf("Its Saturday"); break; case 7: printf("Its Sunday"); break; default: ...
Reading Time:
3 Min

@way2themes