Program to find ASCII value of any character/number in C & C++

Program to find ASCII value of any character/number in C

code:-

#include <stdio.h>
int main()
{
    char c;
    printf("Enter a character: ");
 
    scanf("%c", &c);
    printf("ASCII value of %c = %d", c, c);
 

}


Console Screen

Input:-4
Output:-52

Program to find ASCII value of any character/number in C++

#include <iostream>
using namespace std;
int main()
{
 char c;
 cout << "Enter a character: ";
 cin >> c;
 cout << "ASCII Value of " << c << " is " << int(c);
 return 0;

}


Console screen
Input:- k
Output:- 107

WAP to Find Greatest Digit in C++

WAP to Greatest Digit in C++ for 3 numbers:-

#include<iostream>
using namespace std;
int main()
{
int a,b,c,g;
cout<<"ENTER THREE NUMBERS\n";
cin>>a>>b>>c;
    g=a;
 
    if(b>g)
    {
    g=b;
}
if(c>g)
{
g=c;
}
cout<<"Greatest number is:- "<<g;
}

INPUT:-


5

85

225


OUTPUT:-

Output Console


Greatest number is:- 225


WAP to Greatest Digit in C++ for n numbers:-

#include<iostream>
using namespace std;
int main()
{
int n,g,i;
cout<<"Enter total no. of Elements"<<endl;
cin>>n;
int a[n];
for(i=0;i<n;i++)
{
cin>>a[i];
}
g=a[0];
for(i=1;i<n;i++)
{
if(a[i]>g)
{
g=a[i];
}
}
cout<<"Greatest Digit out of these "<<n<<" Elements:-"<<g;
}

INPUT:-
5
95
45
65
101
25


OUTPUT:-





Output Console

Greatest Digit out of these 5 Elements:-101








What is Machine learning ? A glance ...

What is Machine learning ? A glance ...



AN ABSTRACT



Machine learning is a use of artificial intelligence (AI) that gives frameworks the capacity to consequently take in and improve as a matter of fact without being expressly modified. Machine learning centers around the advancement of PC programs that can get to information and use it learn for themselves.
Red and Black Robot Statue

The way toward learning starts with perceptions or information, for example, models, direct understanding, or guidance, so as to search for examples in information and settle on better choices later on dependent on the precedents that we give. The essential aim is to permit the PCs adapt consequently without human intercession or help and change activities in like manner.

EVOLUTION OF MACHINES



As you most likely are aware, we are living in the realm of people and machines. The Humans have been advancing and gaining from their past experience since a large number of years. Then again, the period of machines and robots have recently started. You can consider it in a manner that as of now we are living in the crude time of machines, while the eventual fate of machine is gigantic and is past our extent of creative mind. 

In this day and age, these machines or the robots must be modified before they begin adhering to your directions. Be that as it may, imagine a scenario where the machine began taking in alone from their experience, work like us, have a feeling that us, do things more precisely than us. These things sound interesting, Right? All things considered, simply recollect this is only the start of the new period.

FORMS OF MACHINE LEARNING 

Man in Front of Monitor

Supervised Learning Algorithm In this you need to completly train the machine in order to make it perfectly working, it needs a lot of database to work perfectly

Unsupervised Learning  Algorithm – 
In this, machine mostly learn itself for being perfect, it does not need any labeled data machine itself even finds some hidden data projections       
                            .
Reinforcement Learning – It works on the method of hit and trial to increase speed, The operator is remunerated with a point for a right or a wrong answer, and based on the positive reward focuses picked up the model trains itself. Furthermore, again once prepared it prepares to foresee the new information introduced to it 



Few Examples of machine learning

  • Virtual Assistants:- Siri, Google assistant  and alexa are some of its examples. You can find them easily on smartphones, smart speakers like google home and Smartphone apps
  • Traffic Predictions:- A common example of this can be seen in your Google Maps App as it gives you   traffic prediction in your area , which help you to select the better way that fits                                            best for your  commute.
Gps On Phone
  • Video Surveillance:-The video camera framework these days are fueled by AI that causes it  conceivable to distinguish wrong doing before they to occur. They track uncommon conduct of individuals like standing unloving for quite a while, bumbling, or resting on seats and so on. The framework would thus be able to give a caution to human specialists, which can at last assistance to stay away from  disasters

  • Social Media Services:-From customizing your news feed to better promotions focusing via, web-based networking media stages are using AI for their own and client benefits. Here are  a couple of models that you should notice, utilizing, and adoring in your internet based life accounts, without understanding that these superb                                                           highlights are only the utilization of ML.
Close-up Photography of Smartphone Icons
  • Better Predictions:- As ML calculations increase involvement, they continue improving in precision and effectiveness. This gives them a chance to settle on better choices. Let's assume you have to make a climate figure model. As the measure of information you have continues developing, your calculations figure out how to make progressively precise forecasts quicker.

C program to Convert Hours into Minutes and Seconds

C program to Convert Hours into Minutes and Seconds 



CODE:-


#include<stdio.h>
#include<conio.h>
int main()
{
int x,y,z;
printf("ENTER TIME IN HOURS\n");
scanf("%d",&x);
z=x*60;
y=z*60;
printf("TOTAL MINUTES=%d\nTOTAL SECONDS=%d",z,y);
getch();
}
INPUT:-


TEST CASE 1:-

::-:: 4


OUTPUT:-



TOTAL MINUTES=240


TOTAL SECONDS=14400


TEST CASE 2:-



::-:: 9



OUTPUT:-



TOTAL MINUTES=540

TOTAL SECONDS=32400

In this program I declared three Variable (x,y,z), x for storing user input, z for storing time in minutes by multiplying x by 60, and y for storing seconds by multiplying z by 60, And then printed them on console screen using printf() function.

It`s Really very easy program to increase your interest in coding & make you comfortable comment down your question or if you want any other Code Comment it down We will provide you as soon as possible


What is CSS??

What is CSS??


Opening shirt CSS 3 vector illustration. Man open shirt to show "CSS" sign in flat cartoon style. Open shirt code, programmer concept

CSS:-CASCADING STYLED SHEETS

CSS is a language used to beautify a HTML webpage So that it can look attractive and more appealing to user. CSS is not a case sensitive language.

There are three ways to embedd CSS to HTML webpage:-

INLINE:- By using STYLE attribute in HTML elements.
INTERNAL:- By using  <style>......</style> element  in <head>......</head> section
EXTERNAL:-By using external CSS file.(* Extension for CSS file is .css *)


All the three ways of adding CSS are similar to each other and its execution is also similar
Programming language concept - PHP, CSS, XML, HTML, Javascript learning - book as laptop

let`s have a code snippet of all three types:-

All the following codes will have same output but in each code snippet we will use different method to embed CSS CODE.




Method 1:- INLINE:-

CODE:-

<html>
<head>
<title> any title </title>
</head>
<body>
<h1 style="color: blue;" >I am heading</h1>
<p style="color: red;">I am paragrah</p>
</body>
</html>



OUTPUT:-


Method 1:- INTERNAL:-

CODE:-

<html>
<head>
<title> CSS EXAMPLES </title>
<style>
h1{
color: blue;
}
p{
color: red;
}
</style>
</head>
<body>
<h1>I am heading</h1>
<p>I am paragrah</p>
</body>
</html>



OUTPUT:-



Method 1:- EXTERNAL:-


CODE:-


1.EXTERNAL CSS FILE

Silver CSS file document icon. Download css button icon isolated on blue background. CSS file symbol. Vector Illustration

h1{
color: blue;
}
p{
color: red;
}


2.HTML:-


<html>
<head>
<title> CSS EXAMPLES </title>
</head>
<body>
<h1>I am heading</h1>
<p>I am paragrah</p>
</body>
</html>

OUTPUT:-


In all the above cases CSS is embeded by using different kind of method but the output is similar in case of all types it doesn`t matter what kind of method we are using, output always remain same.
CSS also have concept of classes which are useful when we need to apply similar kind of  properties
to multiple elements.


C program to Find Sum of numbers and Swap of two numbers using third variable and without using third variable

C PROGRAM TO FIND SUM OF THREE NUMBERS:-

#include
int main()
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
printf("%d",a+b+c);

}



INPUT:-
4
8
2


OUTPUT:-

14






The explaination of this program is very Simple , First of all we declared three  int type variables that is a,b,c
then we took input of their values using scanf() function,
IN C language %d is used for Integer data type
                        %f is used for float data type
                        %lf is used for float data type
then for giving the output on the console screen we used printf() function and computed the sum of three no. using arithematic operator '+'.

We can find sum of n numbers too but for that we need to understand the concept of array in C so will work on that too soon.

C PROGRAM TO SWAP TWO NUMBERS USING THIRD VARIABLES:-



#include

int main()
{
int a,b,c;
scanf("%d%d",&a,&b);
c=a;
a=b;
b=c;
printf("After Swap a=%d\tb=%d",a,b); }




INPUT:-
12
26


OUTPUT:-

a=26
b=12


C PROGRAM TO SWAP TWO NUMBERS WITHOUT USING THIRD VARIABLES:-


#include

int main()
{
int a,b;
scanf("%d%d",&a,&b);
a=a+b;
b=a-b;
a=a-b;
printf("After Swap a=%d\tb=%d",a,b);

}


INPUT:-

42
28


OUTPUT:-

a=28
b=42




My First C program

c

Whenever a person starts learning computer science than the first language which is recommended to him to learn is C
C is a procedural programming programming language, It was developed by  "Dennis ritchie"
in 1963. C is a Low level language and has simple set of pre defined keywords, which makes it easier for begginers to understand

Let`s take a glance at our First Hello World program in C programming language.

#include
int main()
{
printf("HELLO WORLD!");
}


OUTPUT:-

In the above Code :-

  1. #include :- is a header file which must be included in every C program as it contain various definition & function necessary for a C program to work correctly.


There are various other libararies in C such as:-
math.h
stdlib.h
string.h
and various other

2. main() :- Every C program should must have a main function to run a C program, untill unless we don`t go for user-defined function or other user-defined data type, Everything in the program is written inside main function.

3. printf() function :- printf is used to print value of integer , string , char , float etc on the console Screen.

This is just beginning of C programming various big and logic enriched programmes are on the way so stay connected to NADIAN