- #include<stdio.h>
- # include<conio.h>
- void main()
- {
- int a[100],i,n,max,min;
- clrscr();
- printf("How many elements in the array : ");
- scanf("%d",&n);
- printf("Enter the elements : \n");
- for(i=0;i<=n-1;i++)
- {
- scanf("%d",&a[i]);
- }
- max = a[0];
- min = a[0];
- for(i=1;i<=n-1;i++)
- {
- if(max<a[i])
- max = a[i];
- if(min>a[i])
- min = a[i];
- }
- printf("maximum element in the array is :%d\n ",max);
- printf("minimum element in the array is : %d\n",min);
- getch();
- }
Monday, 12 December 2016
How to Find Maximum & Minimum Element in the Array Program in C
Get Web Browser Name In C#
- public string GetWebBrowserName()
- {
- string WebBrowserName = string.Empty;
- try
- {
- WebBrowserName = HttpContext.Current.Request.Browser.Browser;
- }
- catch (Exception ex)
- {
- throw new Exception(ex.Message);
- }
- return WebBrowserName;
- }
DOS Command (CMS) Create Folder Current Datetime and Move Files Shared Folder
- @echo off
- set hh=%time:~-11,2%
- set /a hh=%hh%+100
- set hh=%hh:~1%
- set dateseed=%date:~10,4%%date:~4,2%%date:~7,2%_%hh%
- %time:~3,2%%time:~6,2%
- if not exist "\\140.175.165.10\Sharing\Databasebackup\
- %dateseed%" mkdir "\\140.175.165.10\Sharing
- \Databasebackup\%dateseed%"
- copy D:\HELLO "\\140.175.165.10\Sharing\Databasebackup\
- %dateseed%"
Friday, 9 December 2016
How to Use While LOOP in SQL
- DECLARE @TOTALV BIGINT
- DECLARE @InitialValue BIGINT
- SET @InitialValue=1
- SET @TOTALV=12
- WHILE (@InitialValue<=@TOTALV)
- BEGIN
- print @InitialValue
- SET @InitialValue=@InitialValue+1
- END
Tuesday, 6 December 2016
SQL Function Get Total Time in HH:MM:SS
- CREATE FUNCTION [dbo].TotalTime
- (
- @StartTime DATETIME,
- @EndTime DATETIME
- )
- RETURNS Varchar(10)
- AS
- begin
- DECLARE @D VARCHAR(400)='31784'
- Declare @outTime Varchar(10);
- SELECT @D = DATEDIFF(SECOND,@StartTime,@EndTime)
- SELECT @outTime =CONVERT(VARCHAR(5), @D/60/60)
- + ':' + RIGHT('0' + CONVERT(VARCHAR(2), @D/60%60), 2)
- + ':' + RIGHT('0' + CONVERT(VARCHAR(2), @D % 60), 2)
- RETURN @outTime
- END
- GO
- SELECT dbo.TotalTime('2016-08-10 10:36:01.000','2016-08-10 19:25:45.000')
How to remove empty lines in text In Visual
Visual Studio has ability to delete empty lines in replace operation using regular expressions.
- Click Ctrl-H (quick replace)
- Tick "Use Regular Expressions"
- In Find specify
^$\n
- In Replace box delete everything.
- Click "Replace All"
All empty lines will be deleted.
Regular expression for empty line consist of
Beginning of line
^
End of line
$
Line break
\n
SQL Group With Group Total
- SELECT isnull(WO_status,0) as WO_status,
- (case when MwO.WO_status=1 then 'Open' when MwO.WO_status=2 then 'Close' when MWO.WO_status=3 Then 'Short Close'
- when MwO.WO_status=4 then 'Cancel'
- else 'Total' end) as statusR,
- count(*) as countValue
- FROM M_WorkOrder MwO
- inner join M_WorkorderDetails MwOd on MwO.WOID=MwOd.WOD_WOID
- INNER join BILL_KEYWORD BK on BK.id=MwOd.WOD_KEYID
- INNER join billing_from bf on bf.id=MwO.WO_CID
- where (MwOd.WOD_CUserID=15 or 15 =0 )
- group by WO_status WITH ROLLUP
Subscribe to:
Posts (Atom)
Upload valid file in C#
protected bool CheckFileExtandLength(HttpPostedFile HtmlDocFile) { try { Dictionary<string, byte[]...
-
Setting Header Programatically You can also set the cache headers programmatically. This can be useful for generated content and allows m...
-
CREATE TABLE dbo.M_Bank ( ID INT IDENTITY NOT NULL, MB_NAME NVARCHAR (50), MB_SNAME NVARCHAR (20), MB_ADDUSER ...
-
SELECT distinct(volume_mount_point), total_bytes/1048576 as Size_in_MB, total_bytes/1048576/1024 as Size_in_GB, available_bytes/1048576 ...