C break and continue
Break and Continue in C language | part 9 =total programming
Switch Case in C language | part 8 = total programming
Switch Case in C language
SWITCH CASE =
DEFINITION = Switch Case is a statement in C language. The switch statement in C tests the value of a variable and compares it with multiple cases. Once the case match is found a block of statements associated with that particular case is executed.
SYNTAX = The general syntax for Switch Case is as follows =
switch( expression )
{
case value-1:
Block-1;
Break;
case value-2:
Block-2;
Break;
case value-n:
Block-n;
Break;
default:
Block-1;
Break;
}
Statement-x; KEYWORDS IN SWITCH CASE = switch, case, break, and default.
FLOWCHART OF SWITCH CASE =
Example =
#include <conio.h>#include <stdio.h>main(){ int x = 2; switch (x) { case 1: printf("Choice is 1"); break; case 2: printf("Choice is 2"); break; case 3: printf("Choice is 3"); break; default: printf("Choice other than 1, 2 and 3"); break; }}Calculator Program in C language | part 7 = total programming
Calculator Program
Hello guys, in this post I am going to give you a practice program which is an ATM program it is very simple which not include any graphics.
so let us move on to the program.
Source code =
#include<stdio.h>
#include<conio.h>
void main()
{
float ch,ad1,ad2,sb1,sb2,mt1,mt2,di1,di2;
printf("\n\t\nplease enter what you want to do in calculator");
printf("\n\t1.Addition");
printf("\n\t2.Subtraction");
printf("\n\t3.Multiplication");
printf("\n\t4.Division");
printf("\n\n\tEnter your Choose= ");
scanf("%f",&ch);
if (ch==1)
{
printf("\n\tenter the first digit= ");
scanf("%f",&ad1);
printf("\n\tenter the second digit= ");
scanf("%f",&ad2);
float ans1=ad1+ad2;
printf("\n\tAnswer= %f",ans1);
printf("\n\tAddition is done");
}else if (ch==2)
{
printf("\n\tenter the first digit= ");
scanf("%f",&sb1);
printf("\n\tenter the second digit= ");
scanf("%f",&sb2);
float ans2=sb1-sb2;
printf("\n\tAnswer= %f",ans2);
printf("\n\tSubtraction is done");
}else if (ch==3)
{
printf("\n\tenter the first digit= ");
scanf("%f",&mt1);
printf("\n\tenter the second digit= ");
scanf("%f",&mt2);
float ans3=mt1*mt2;
printf("\n\tAnswer= %f",ans3);
printf("\n\tMultiplication is done");
}else if (ch==4)
{
printf("\n\tenter the first digit= ");
scanf("%f",&di1);
printf("\n\tenter the second digit= ");
scanf("%f",&di2);
float ans4=di1/di2;
printf("\n\tAnswer= %f",ans4);
printf("\n\tDivision is done");
}
}
my youtube video for more information =
ATM program in C language | part 6 = total programming
ATM Program
Hello guys, in this post I am going to give you a practice program which is an ATM program it is very simple which not include any graphics.
so let us move on to the program.
Source code =
#include<stdio.h>
#include<conio.h>
void main()
{
float p,t;
float r=7.5;
int pas;
printf("\n\n\t\t\t\t\t\t Welcome to our bank");
printf("\n\n\t Please insert your card");
printf("\n\n\t Card is inserted");
printf("\n\n\t enter the password= ");
scanf("%d",&pas);
if(pas==1234)
{
printf("\n\t password is correct");
}else
{
printf("\n\t password is invalid");
exit(0);
}
printf("\n\n\t enter the amount you want to take on loan= ");
scanf("%f",&p);
printf("\n\t Rate of interest= %f",r);
printf("\n\n\t enter the time in years= ");
scanf("%f",&t);
float si=(p*r*t)/100;
float ans=si+p;
printf("\n\tamount will be return by you after given time= %f",ans);
printf("\n\n\t\t\t\t\t\t|| thank u visit again ||");
}
my youtube video for more information =
Scanf function in C language | Part 5= total programming,C language
Scanf function in C language
*SCAN F=
DEFINITION = Scanf function allows the users to put the value for their data in run time.
SYNTAX = scanf("format string",argument_list);
EXAMPLE =
#include<conio.h>
#include<stdio.h>
void main()
{
int number;
printf("enter a number:");
scanf("%d",&number);
printf("cube of number is:%d ",number*number*number);
}
My YouTube related to scanf ,please watch=
Loops in C language | Part 4 = total programming,C language
Datatypes in C language | part 3 total programming = C language
Datatypes in C language
Break and Continue in C language | part 9 =total programming
C break and continue Hello Guys, in this post I am going to show you C Break and Continue, So, Let get started = ...





