Add Date and Time in HTML5

Vrundesha Joshi
Updated on 02-Mar-2020 12:23:18

4K+ Views

Use the tag to add date and time. The HTML tag is used for displaying the human readable date and time.The HTML tag also supports the following additional attribute −AttributeValueDescriptiondatetimedatetimeIt is a machine readable date timeExampleYou can try to run the following code to learn how to add date and time in HTML5 −           HTML time Tag               The time is 08:30 pm    

Create Table Heading in HTML

V Jyothi
Updated on 02-Mar-2020 12:20:32

714 Views

Use the tag in HTML to create a heading. The HTML tag is used for specifying a header cell or table header within a table.The following are the attributes −AttributeValueDescriptionabbrabbreviated_textDeprecated − Specifies an abbreviated version of the content in a header cell.alignrightleftcenterjustifycharDeprecated − Content alignment in header cell.axisNameDeprecated − Specifies a category for this th.bgcolorrgb(x, x, x)#hexcodecolornameDeprecated − Specifies the background color of the header cell.charCharacterDeprecated − Specifies which character to align text on. Used when align = "char"charoffpixels or %Deprecated − Specifies an alignment offset (either in pixels or percentage value) against the first character as specified ... Read More

Include an Abbreviation in HTML

Nishtha Thakur
Updated on 02-Mar-2020 12:18:45

214 Views

The HTML tag is used for indicating an abbreviation. You can try to run the following code to learn how to include an abbreviation in HTML −Example        HTML abbr Tag                     pvt.             WHO       promotes the global game.                

Thread Functions in C/C++

Ayush Gupta
Updated on 02-Mar-2020 11:16:59

2K+ Views

In this tutorial, we will be discussing a program to understand thread functions in C/C++.Thread functions allow users to implement concurrent functions at the same time, which can either be dependent on each other for execution or independent.Example#include #include #include void* func(void* arg){    //detaching the current thread    pthread_detach(pthread_self());    printf("Inside the thread");    pthread_exit(NULL); } void fun(){    pthread_t ptid;    //creating a new thread    pthread_create(&ptid, NULL, &func, NULL);    printf("This line may be printed before thread terminates");    if(pthread_equal(ptid, pthread_self())       printf("Threads are equal");    else       printf("Threads are ... Read More

Templates and Static Variables in C++

Ayush Gupta
Updated on 02-Mar-2020 11:13:22

591 Views

In this tutorial, we will be discussing a program to understand templates and static variables in C++.In case of function and class templates, each instance of the templates has its own local copy of the variables.Example Live Demo#include using namespace std; template void fun(const T& x){    static int i = 10;    cout

Template Specialization in C++

Ayush Gupta
Updated on 02-Mar-2020 11:11:13

183 Views

In this tutorial, we will be discussing a program to understand Template specialization in C++.Standard functions like sort() can be used with any data types and they behave the same with each of them. But if you want to set a special behaviour of the function for a particular data type (even user defined), we can use template specialization.Example Live Demo#include using namespace std; template void fun(T a) {    cout

Swapping Subranges from Different Containers in C++

Ayush Gupta
Updated on 02-Mar-2020 11:05:38

96 Views

In this tutorial, we will be discussing a program to understand swapping of subranges of different containers in C++.For this we will be provided with vectors and lists, and we need to swap some of their elements.Example Live Demo#include #include #include #include using namespace std; int main(){    vector v = { -10, -15, -30, 20, 500 };    list lt = { 10, 50, 30, 100, 50 };    swap_ranges(v.begin(), v.begin() + 3, lt.begin());    for (int n : v)       cout

Sum Two Integers Without Using Arithmetic Operators in C/C++

Ayush Gupta
Updated on 02-Mar-2020 11:02:56

610 Views

In this tutorial, we will be discussing a program to understand how to sum two integers without using arithmetic operators in C/C++.For adding two integers without using arithmetic operators, we can do this with either using pointers or using bitwise operators.ExampleUsing pointers#include using namespace std; int sum(int a, int b){    int *p = &a;    return (int)&p[b]; } int main() {    int add = sum(2,3);    cout

Store Data Triplet in a Vector in C++

Ayush Gupta
Updated on 02-Mar-2020 10:56:12

647 Views

In this tutorial, we will be discussing a program to understand how to store a Data triplet in a vector in C++.To store three elements in a single cell of a vector we will creating a user defined structure and then make a vector from that user defined structure.Example Live Demo#include using namespace std; struct Test{    int x, y, z; }; int main(){    //creating a vector of user defined structure    vector myvec;    //inserting values    myvec.push_back({2, 31, 102});    myvec.push_back({5, 23, 114});    myvec.push_back({9, 10, 158});    int s = myvec.size();    for (int i=0;i

Restrict Dynamic Allocation of Objects in C++

Ayush Gupta
Updated on 02-Mar-2020 10:47:03

255 Views

In this tutorial, we will be discussing a program to understand how to restrict dynamic allocation of objects in C++.For this we will be keeping the new operator function private so that objects cannot be created using it dynamically.Example Live Demo#include using namespace std; class Test{    //making new operator private    void* operator new(size_t size);    int x;    public:    Test() { x = 9; cout

Advertisements