How to reverse a given number using C

Updated on 16-Dec-2021 15:57:52
#include <stdio.h> int main() { int num, rem, rev = 0; printf("\nEnter any no to be reversed : "); scanf("%d", &num); while (num >= 1) { rem = num % 10; rev = rev * 10 + rem; num = num / 10; } printf("\nReversed Number : %d", rev); return (0); } Output : Enter any no to be reversed : 123 Reversed Number : 321 ... Read More

How to calculate gross salary of a person using C Program

Updated on 16-Dec-2021 15:48:12
#include <stdio.h> int main() { int gross_salary, basic, da, ta; printf("Enter basic salary : "); scanf("%d", &basic); da = (10 * basic) / 100; ta = (12 * basic) / 100; gross_salary = basic + da + ta; printf("\nGross salary : %d", gross_salary); return (0); } Output : Enter basic Salary : 1000 Gross Salart : 1220 ... Read More

Advertisements

Updated on 16-oct-2001 12:00:00

How to reads customer number and power consumed and prints amount to be paid using C

Updated on 16-Dec-2021 15:43:12
An electric power distribution company charges its domestic consumers as follows Consumption Rate of Units Charge ------------------------------------ 0-200 Rs.0.50 per unit 201-400 Rs.100 plus Rs.0.65 per unit excess 200 401-600 Rs.230 plus Rs.0.80 per unit excess of 400. ------------------------------------ Write a C program that reads the customer number and power consumed and prints the amount to be paid by the customer. P... Read More

How to read the values of x, y and z and print the results expressions in one line using C Program

Updated on 16-Dec-2021 15:31:37
Problem Statement : Write a program to read the values of x, y and z and print the results of the following expressions in one line. (x+y+z) / (x-y-z) (x+y+z) / 3 (x+y) * (x-y) * (y-z) Program : #include<stdio.h> #include<conio.h> void main() { int x, y, z; float a, b, c; clrscr(); printf("\nEnter the values of x,y and z : "); scanf("%d %d %d", &x, &y, &z); a = (x + y + z) / (x - y - z); b = (x + y + z) / 3; c = (x + y) * (x - y) ... Read More

How can I see all tables in SQL?

Updated on 14-Dec-2021 17:13:39
Different database management systems have different queries to see all the tables. To see all the tables in MYSQL, we would have to use this query: show tables; This is how we can see all tables in ORACLE: SELECT table_name FROM User_tables; This is how we can extract all tables in SQL Server: SELECT * FROM Information_schema.tables; ... Read More

Advertisements

Updated on 16-oct-2001 12:00:00

What is MYSQL ?

Updated on 14-Dec-2021 17:11:27
To understand exactly what is MYSQL, we need to understand what is DBMS and RDBMS. DBMS stands for Database Management System. When we have a huge database with us, we would need a proper management system which would help us organise this database.  There are 4 types of database management systems: Hierarchical Network Relational Object – Oriented. Out of these database management systems, MYSQL comes under the category of Relational database management system.  A relati... Read More

What is PL/SQL ?

SQL
Updated on 14-Dec-2021 17:09:39
PL SQL stands for Procedural language constructs for Structured Query Language. PL SQL was introduced by Oracle to overcome the limitations of plain sql. So, pl sql adds in procedural language approach to the plain vanilla sql. One thing to be noted over here is that pl sql is only for oracle databases. If you don’t have an Oracle database, then you cant work with PL SQL. While, with the help of sql, we were able to DDL and DML queries, with the help of PL SQL, we will be able to create ... Read More

Advertisements

Updated on 16-oct-2001 12:00:00

How do I view tables in SQL ?

Updated on 14-Dec-2021 17:07:50
To view tables in SQL, all you need to do is give this command: Show tables; ... Read More

What is Primary Key in SQL ?

Updated on 14-Dec-2021 17:04:38
Primary Key is a constraint in SQL. So, before understanding what exactly is a primary key, let’s understand what exactly is a constraint in SQL. Constraints are the rules enforced on data columns on a table. These are used to limit the type of data that can go into a table. Constraints can either be column level or table level. Let’s look at the different types of constraints which are present in SQL: Constraint Description NOT NULL Ensures that a column cannot have a NUL... Read More
Previous 1
  • 3 4 5 6 79 Next
    Advertisements

    ads