Thursday, 27 May 2021
navigation CSS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>navigation </title>
<style>
.navbar {
background-color: red;
}
.navbar li {
float: left;
list-style: none;
}
.navbar ul {
overflow: auto;
}
.navbar li a {
padding: 3px 3px;
margin: 3px 3px;
}
</style>
</head>
<body>
<header>
<nav class="navbar">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</nav>
</header>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>navigation </title>
<style>
.navbar{
background-color: black;
border-radius: 15px;
}
.navbar li{
float: left;
list-style: none;
margin: 10px;
}
.navbar ul{
overflow: auto;
margin: 5px 10px;
}
.navbar li a{
padding: 20px 5px;
color: white;
text-decoration: none;
}
.navbar li a:active{
color: red;
}
.navbar li a:hover{
background-color: yellow}
.search{
float: right;
color: white;
padding: 10px ;
}
.navbar input{
border-radius: 10px;
padding: 5px;
}
</style>
</head>
<body>
<header>
<nav class="navbar">
<ul>
<li><a href="#">Home</a></li>
<li><a href="#">About</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Contact Us</a></li>
<div class="search">
<input type="text" name="search " id="search" placeholder="Type here to search">
</div>
</ul>
</nav>
</header>
</body>
</html>
Button effect CSS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Button effect</title>
<style>
.container {
width: 900px;
border: 3px solid black;
margin: 15px auto;
padding: 5px 10px;
background-color: rgb(248, 236, 236);
}
a {
text-decoration: none;
color: white;
}
a:hover {
color: yellow;
}
a:active {
background-color: green;
}
a:visited {
background-color: indigo;
}
.btn {
border: 2px solid black;
border-radius: 3px;
cursor: pointer;
background-color: red;
padding: 5px;
font-size: 12px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
color: white;
}
.btn:hover {
color: yellow;
border: 3px solid black;
}
.btn:active {
background-color: green;
}
</style>
</head>
<body>
<div class="container">
<h2>This is my frist blog</h2>
<p id="containerpara" class="para">Lorem ipsum dolor sit amet consectetur adipisicing elit. Earum illum laborum,
officiis neque alias necessitatibus saepe eius quidem. Ipsam exercitationem sit obcaecati quas consequatur
similique recusandae veniam, dolor doloremque tenetur illo fugit error nihil?</p>
<a href="Https://Linkedin.com " target="_blank" class="btn">Read more</a>
<button class="btn">Next</button>
</div>
</body>
</html>
Alignment in CSS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>float and basic web </title>
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Dancing+Script:wght@600&family=Slabo+27px&display=swap"
rel="stylesheet">
<style>
body {
font-family: 'Dancing Script', cursive;
font-family: 'Slabo 27px', serif;
}
* {
box-sizing: border-box;
}
.container {
width: 900px;
border: 3px solid rgb(214, 177, 177);
background-color: white;
margin: 30px auto;
}
.items {
border: 2px solid black;
background-color: rgb(203, 203, 236);
margin: 12px 3px;
padding: 12px 3px;
}
#fruits {
float: left;
width: 48%;
}
#computers {
float: right;
width: 48%;
}
#vegetables {
clear: both;
}
p,
h2 {
text-align: right;
text-align: left;
text-align: center;
text-align: justify;
text-align: center;
}
h1 {
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<h1>Welcome To My Store</h1>
<div id="fruits" class="items">
<h2>Fruits</h2>
<p id="fruitspara" class="para">Lorem ipsum dolor sit amet consectetur adipisicing elit. Odit iste eveniet
laudantium non doloribus quae consequatur nisi? Quaerat consequuntur natus deserunt repellendus magni
debitis commodi suscipit tempore ut, maxime, autem asperiores vitae unde. Quod.
Lorem ipsum dolor sit amet consectetur adipisicing elit. Provident error eaque ex laborum. Voluptate
enim officia labore delectus velit animi consequatur laborum placeat. Molestiae sint nobis eius
exercitationem mollitia obcaecati.
</p>
</div>
<div id="computers" class="items">
<h2>Computer</h2>
<p id="computerspara" class="para">Lorem ipsum dolor sit amet consectetur adipisicing elit. Pariatur
reiciendis amet voluptatem, iure voluptates sit dolor facilis dolore ab neque dignissimos explicabo
quisquam hic placeat quis voluptas voluptate. Quas eius libero quisquam voluptatum doloribus. Lorem
ipsum dolor sit, amet consectetur adipisicing elit. Sapiente enim autem distinctio, amet quae at
pariatur alias nobis fugiat mollitia consequuntur assumenda necessitatibus vel, minus voluptate earum
labore rem ut?</p>
</div>
<div id="vegetables" class="items">
<h2>Vegetables</h2>
<p id="vegetablespara" class="para">Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quis sint
dolorum dolore repellendus. Accusamus, accusantium? Maiores dolorum sit praesentium eum ab minus optio
expedita eaque exercitationem necessitatibus incidunt, ipsa molestias ipsam illum consectetur ut!</p>
</div>
<div id="glasses" class="items">
<h2>Glasses</h2>
<p id="glassespara" class="para">Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quis sint dolorum
dolore repellendus. Accusamus, accusantium? Maiores dolorum sit praesentium eum ab minus optio expedita
eaque exercitationem necessitatibus incidunt, ipsa molestias ipsam illum consectetur ut!</p>
</div>
</div>
</body>
</html>
Developer Tools
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Developer Tools</title>
<link rel="stylesheet" href="tut16.css">
</head>
<body>
<h1>Developer Tools</h1>
<p class="bgyellow">This is my frist ever para in chrome</p>
</body>
</html>
CMD tips
CMD Training
/outside
inside -\
Directory is the location for storage of
file in hierachial format.
To navigate to your home directory, use "cd" or
"cd ~" To navigate up one directory level, use "cd .." To navigate to the previous directory (or back),
use "cd -" To navigate into the root directory, use "cd /"
make dir = mkdir
remove dir = rmdir
if there is folders inside directory
then
How to delete
rmdir /s folder names
path variables is just a shortcut in CMD
wmic logicaldisk get name
disk nmaes
del - delete
type - print
dir > abc.text
echo hrllo > shs.text
echo ducduc >> shs1.text
type text
dir e: cuurent doesn't affect
C problems
// write a program to find any number raise power
//author: Upendra Date:10/27/2020
#include <math.h>
void main()
{
int a, b, n;
printf("Enter the two number to get power:\n");
scanf("%d%d", &b, &n);
a = pow(b, n);
printf("Answer is %d", a);
}
/*write a program to print all
even number from 1 to 100*/
#include<stdio.h>
void main()
{
int n=1;
for(n=1;n-->=1&&n--<=100)
printf("%d\n",n);
}
/* write a program to print
alphabet from a to z*/
#include<stdio.h>
void main()
{
char ch='A';
while(ch<='Z')
{
printf("%c\n",ch);
ch++;}
}
// rectangle
#include <stdio.h>
int main()
{
int a = 32;
int b = 32;
printf("area of rectangle is a*b is %d", a * b);
return 0;
}
// rectangle
# include<stdio.h>
int main(){
int a;
int b;
int c;
printf("length of rec is a:");
scanf("%d",&a);
printf("breadth of rec is b:");
scanf("%d",&b);
c=a*b;
printf("area of rectangle is a*b is %d",c);
return 0;
}
// area of circle
# include<stdio.h>
int main(){
float r,a;
printf("Radius of a circle is r:");
scanf("%f",&r);
printf("area of circle is %f",r*r);
return 0;
}
// volume of cylinders
# include<stdio.h>
main(){
float v,r,h; // v- volume , pi- 3.14, r-radius,h-height
float pi=3.14;
printf("Enter the radius of cyclinders:");
scanf("%f",&r);
printf("Enter the height of cyclinders:");
scanf("%f",&h);
v=pi*(r*r)*h;
printf("Volume of a cyclinder is %f",v);
}
# include<stdio.h>
main(){
float c,f; // c - celsius, f- fahreint
printf("Enter the temperature in celsius:");
scanf("%f",&c);
f=(c*9/5)+32;
printf("temperature in faherient is %f",f);
}
// find the final amount in simple interest of shaam
# include<stdio.h>
main(){
float Si,p,r,Total_Amount; // simple inters, principle , rate of interest, time of year
int t;
printf("Enter the principle amount:");
scanf("%f",&p);
printf("Enter the rate of interest:");
scanf("%f",&r);
printf("Enter the time in year:");
scanf("%d",&t);
Si=(p*r*t)/100;
printf("Simple interest of shaamu is %f \n\n",Si);
Total_Amount=p+Si;
printf("Total Amount after %d year is %f",t,Total_Amount);
}
#include <stdio.h>
int main()
{
int a = 16, c, u, b;
a = c = u = b;
printf("The value of a is %d \n", c);
printf("The value of a is %d", u);
}
#include <stdio.h>
int main()
{
int marks1,marks2,marks3,Total_marks;
printf("Enter the marks of each subject:\n ");
scanf("%d%d%d \n",&marks1,&marks2,&marks3);
Total_marks=(marks1+marks2+marks3)/3*3;
printf("Total_marks of Student is %d \n",Total_marks);
if ((marks1>=33&&marks2>=33&&marks3>=33)&&(Total_marks>=40))
{
printf("You are passed CongraT!");
}
else
{
printf("You are Fail");
}
return 0;
}
// create a program to add and sub and multi and divide two number
# include<stdio.h>
int main(){
int a = 25;
int b= 30;
int c ;
c = a+b;
printf("Sum of a and b is %d",c);
return 0;
}
// write a program to find area of retangle using
# include<stdio.h>
int main(){
int l,b,a; // area of rectangle
printf("length of rectangle is :");
scanf("%d",&l);
printf("breadth of rectangle is :");
scanf("%d",&b);
a=l*b;
printf("area of rec is %d",a);
return 0;
}
#include<stdio.h>
int main()
{
int i,j,rows; // N is no. of rows
printf("Enter the no.of rows:\n");
scanf("%d",&rows);
for(i=1;i<=rows;i++)
{
for(j=1;j<=rows-i;j++)
{
printf(" ");}
for(j=1;j<=(2*i-1);j++)
{
if(j==1||i==rows||j==(2*i-1))
printf("*");
else
{
printf(" ");
}
}
printf("\n");
}
}
/**
* C program to print equilateral triangle or pyramid star pattern
*/
#include <stdio.h>
int main()
{
int i, j, rows;
/* Input number of rows to print */
printf("Enter number of rows : ");
scanf("%d", &rows);
/* Iterate through rows */
for(i=1; i<=rows; i++)
{
/* Print leading spaces */
for(j=i; j<rows; j++)
{
printf(" ");
}
/* Print star */
for(j=1; j<=(2*i-1); j++)
{
printf("*");
}
/* Move to next line */
printf("\n");
}
return 0;
}
// write a program to print pyramid pattern in c
#include <stdio.h>
int main()
{
int i, j, N; // N is no of input row
printf("Enter the input row:\n");
scanf("%d", &N);
for (i = 1; i <= N; i++)
{
for (j = 1; j < N; j++)
{
printf(" ");
}
for (j = 1; j <= (2 * i - 1); j++)
{
printf("*");
}
printf("\n");
}
}
// write a program to draw pyramid using star pattern
#include <stdio.h>
int main()
{
int i, j, N, M; // N is a row input and M is a col
printf("Enter the input rows and col");
scanf("%d%d", &N, &M);
for (i = 1; i <= N; i++)
{
for (j = 1; j <= M; j++)
{
printf("*");
}
printf("\n");
}
}
// write a program to find area of retangle using
# include<stdio.h>
int main(){
int l,b,a; // area of rectangle
printf("length of rectangle is :");
scanf("%d",&l);
printf("breadth of rectangle is :");
scanf("%d",&b);
a=l*b;
printf("area of rec is %d",a);
return 0;
}
// write a program to build a structure like of black square emoji
#include<stdio.h>
int main()
{
int i,j,N; //ith row ,jth column,N is a no. of rows
printf("Enter the no. of rows:\n");
scanf("%d",&N);
for(i=1;i<=N;i++)
{
for(j=1;j<=N;j++)
{
if(i==1||i==N||j==1||i==N-5||i==5||j==5)
printf("*");
else
{
printf(" ");
}
}
printf("\n");
}
}
C Problems
#include<stdio.h>
void main()
{
int n;
for(n=0;n<=0;n--)
printf("system is hacked %d\n",n);
}
// write a program to write a simple interest simply formula to calculate it
#include <stdio.h>
void main()
{
int prin, noy; // prin-principle amount,noy-number of year
float roi, si; // roi-rate of interest,si-simple interest
printf("enter the prin amount,roi,noy:\n");
scanf("%d%d%f", &prin, &noy, &roi);
si = (prin * (roi / 100) * noy) / 100;
printf("Simple Interest is %f", si);
}
/* shortest program to print 1 to 10
*/
#include<stdio.h>
void main()
{int a;
for(a=0;a++>=0&&a++<11;a++)
printf("%d\n",a);
}
/*write a program say sorry
*/
#include<stdio.h>
void main()
{
int a=0;
for(a=0;a<10;a++)
printf(" SO Sorry\n ");
}
//write a program for salary of an employees
//with the HRA is given and DA is given
#include<stdio.h>
void main()
{
int basic_salary;
float HRA,DA,gross_salary;
printf("Enter yours Basic salary:\n");
scanf("%d",&basic_salary);
if(basic_salary<=10000)
{
HRA=basic_salary*0.20;
DA=basic_salary*0.80;
gross_salary=basic_salary+HRA+DA;
}
else if(basic_salary<=20000)
{
HRA=basic_salary*0.25;
DA=basic_salary*0.90;
gross_salary=basic_salary+HRA+DA;
}
else if(basic_salary>20000)
{
HRA=basic_salary*0.30;
DA=basic_salary*0.95;
gross_salary=basic_salary+HRA+DA;
}
printf("yours HRA is %2f\n",HRA);
printf("your DA is %2f\n",DA);
printf("yours gross salary is %2f\n",gross_salary);
}
//write a basic salary of a ramesh
// author:upendra date:10/27/2020
#include<stdio.h>
void main()
{
int basic_salary; // baisc salary of a ramesh
float DA,HRA,gross_salary; //DA- dearness allowance HRA- house renta allowance
printf("Enter the Basic salary :\n");
scanf("%d",&basic_salary);
DA=0.4*basic_salary;
HRA=0.2*basic_salary;
gross_salary=basic_salary+DA+HRA;
printf("Gross salary of a ramesh is %f",gross_salary);
}
// write a program to input basic salary of an employees
// to calculate gross salary of an emloyees
#include<stdio.h>
void main()
{
int basic_salary;
float gross_salary;
printf("Enter the Basic salary of an Employees:\n");
scanf("%d",&basic_salary);
if(basic_salary<=10000)
{
gross_salary=((basic_salary*0.20)+(basic_salary*0.80));
printf("yours actual salary is %f",gross_salary);
}
else if(basic_salary<=20000)
{
gross_salary=((basic_salary*0.25)+(basic_salary*0.90));
printf("yours actual salary is %f",gross_salary);
}
else if(basic_salary>20000)
{
gross_salary=((basic_salary*0.30)+(basic_salary*0.95));
printf("yours actual salary is %f",gross_salary);
}
}
/*Runner*/
#include<libbgi.a>
#include<stdio.h>
#include<math.h>
void main()
{
int driver=DETECT,mode,j=100,i=0,x1,x22,x2,x11,y1,y11,y2,y22,a,y,k,speed;
float ang1=3.839724354,ang2=5.585053606, c1=0.05,
c2=-0.05,var1=2.967059728,var2=5.410520681,d1=0.072,d2=-0.072,s=2.35619449
;
initgraph(&driver,&mode,"C:\tc\bgi");
printf("
Enter the number of rounds
"); scanf("%d",&k);printf("
Enter 1 for fast speed or 2 for normal speed
");scanf("%d",&speed);
if(speed==1) speed=11; else speed=16;cleardevice();delay(1000);
while(k>=1)
{
while(i<=700)
{setcolor(8);
circle(i,j,22);line(i,j+22,i-13,j+115);
x1=i+50*cos(ang1);x2=i+50*cos(ang2);
y1=j+22-50*sin(ang1);y2=j+22-50*sin(ang2);
x11=x1+45*cos(ang1+1.54532952); x22=x2+45*cos(ang2+1.54532952);
y11=y1-45*sin(ang1+1.54532952);
y22=y2-45*sin(ang2+1.54532952);setcolor(RED);
line(i,j+22,x1,y1);line(x1,y1,x11,y11);setcolor(GREEN);line(i,j+22,x2,y2);
line(x2,y2,x22,y22);
x1=i-15+60*cos(ang1); x2=i-15+60*cos(ang2);
y1=j+115-60*sin(ang1); y2=j+115-60*sin(ang2);
x11=x1+60*cos(var1); x22=x2+60*cos(var2);
y11=y1-60*sin(var1); y22=y2-60*sin(var2);
line(i-13,j+115,x1,y1);line(x1,y1,x11,y11);setcolor(RED);line(i-13,j+115,x
2,y2);line(x2,y2,x22,y22);
ang1=ang1+c1; ang2=ang2+c2;
var1=var1+d1; var2=var2+d2;if(i==0) a=x22;
if(ang1<=3.839724354){c1=0.05;var1=2.967059728;d1=0.072;}
if(ang1>=5.585053606){c1=-0.05;var1=5.410520681;d1=-0.072;a=x11+10;s=2.356
19449;}
if(ang2<=3.839724354){c2=0.05;var2=2.967059728;d2=0.072;}
if(ang2>=5.585053606){
c2=-0.05;var2=5.410520681;d2=-0.072;a=x22+10;s=2.35619449;}
i=a+150*cos(s)+50;j=320-150*sin(s)-20;s=s-0.045;
delay(speed);if(k!=1)cleardevice();
}
i=0;k--;
}
getch(); }
#include<stdio.h>
void main()
{
int row,col;
for(row=1;row<=4;row++)
{
for(col=1;col<=4;col++)
{printf("%d\t%d\n",row,col);
}
}
}
//write a program to gets marks from the user
#include<stdio.h>
void main()
{
int grade;
printf("enter the grade:\n");
scanf("%d",&grade);
printf("%s\n",grade>=35?"Pass":"Fail");
}
/* passing the values to fuctions */
#include<stdio.h>
int multi(int,int);
void main()
{
int x,y,mul;
printf("Enter the two values to mul:");
scanf("%d%d",&x,&y);
mul=multi(x,y);
printf("Answer is %d",mul);
}
int multi(int a,int b)
{
int ans,a;
ans=a*b;
return(ans);
}
Subscribe to:
Posts (Atom)
Python if / else
Python if / else a1 = int ( input (" Enter the number: \n ")) a2 = int ( input (" Enter the number: \n ")) a3 = int ( i...
-
How To Give Beautiful Heights, Widths,Border,Border-Radius and Background In HTML Using CSS ? CSS Design <! DOCTYPE html > < h...
-
What Is CSS Selectors? CSS Types of Selectors <! DOCTYPE html > < html lang = "en" > < head > < meta...
-
Pointer in c program problems #include <stdio.h> int main () { int i = 34 ; int * j = & i ; int ...