SQL join with example

By using SQL joins , we can retrieve data from  two or more tables based on logical relationships between the tables. SQL JOINS indicate how database should use data from one table to select the rows in others in another table. The function of performing data from multiple tables is called joining. Sql can produce … Read more

Creating Navigation Bar using Bootstrap

Creating Navigation Bar using Bootstrap <!– Example for Navbar –> <html> <head> <!– Import Section –> <link href=”bootstrap.min.css” rel=”stylesheet” /> <!– Script Files –> <script src=”jquery.min.js”></script> <script src=”popper.min.js”></script> <script src=”bootstrap.min.js”></script> <style> #div2 img { width: 200px; height: 140px; margin: 10px; } </style> </head> <body> <h3>Creating Navigation Bar using Bootstrap</h3> <hr/> <div class=”container”> <nav class=”navbar navbar-expand-sm … Read more

FormView Control in aap.net with example

ForThe FormView control is used to displays the values of a single record from a data source using user-defined templates.The FormView control allows you to edit, delete, and insert records. The FormView control is used to display a single record from a data source in a table. When using the FormView control, you specify templates … Read more

ADO tutorial

ado.net in c#

ADO Introduction                       Pretty much every application deals with data in some manner, whether that data comes from memory, databases, XML files, text files, or something else. The location where we store the data can be called as a Data Source or Data Store where a … Read more

c programming practice questions

C Programming Practice Questions

c programming practice questions

What is the output of the following code? 

1.

#include<stdio.h>

main()

{

int i;

for(i=0;i<5;i++)

{

static int a=0;

int b=0;

a++;

b++;

printf(“\na=%d”,a);

printf(“,b=%d”,b);

}

return 0;

}

Ans:

a=1

b=1

a=2

b=1

a=3

b=1

a=4

b=1

a=5

b=1

2.

#include<stdio.h>

main()

{

static int s;

++s;

printf(“\n%d”,s);

if(s<=3)

main();

printf(“\n%d”,s);

return 0;

}

Ans: 1 2 3 4 4 4 4 4

3.

#include<stdio.h>

extern int a;

main()

{

printf(“\na=%d”,a);

return 0;

}

Ans: Linking Error undefined symbol _a

4.

#include<stdio.h>

int a;

main()

{

printf(“\n a = %d”,a);

return 0;

}

Ans: a=0

5.

#include<stdio.h>

extern int a;

main()

{

printf(“\n a = %d”,a);

return 0;

}int a;

Ans: a=0

6.

#include<stdio.h>

extern int a;

main()

{

printf(“\n a = %d”,a);

return 0;

}

int a=5;

Ans: a=5

7.

#include<stdio.h>

extern int a=5;

main()

{

void fun();

printf(“\n a = %d”,a);

fun();

return 0;

}

int a;

void fun()

{

printf(“\n in fun a = %d”,a);

}

Ans: a=5,a=5

8.

#include<stdio.h>

extern int a;

main()

{

void fun();

printf(“\n a = %d”,a);

fun();

return 0;

}

int a=7;

void fun()

{

printf(“\n in fun a = %d”,a);

}

Ans: a=7,a=7

9.

#include<stdio.h>

extern int a=5;

main()

{

void fun();

printf(“\n a = %d”,a);

fun();

return 0;

}

int a;

void fun()

{

printf(“\n in fun a = %d”,a);

}

Ans: a=5,a=5

10.

#include<stdio.h>

void fun(int _)

{

printf(“%d”,_);

}

main()

{

fun(23);

return 0;

}

Ans: 23

11.

#include<stdio.h>

main()

{

auto a;

register r;

static s;

extern e;

printf(“\n%d”,sizeof a);

printf(“\n%d”,sizeof r);

printf(“\n%d”,sizeof s);

printf(“\n%d”,sizeof e);

return 0;

}

Ans: 2 2 2 2

Identify the compiler error in the following code?

#include<stdio.h>

void fun(auto int _)

{

printf(“%d”,_);

}

main()

{

fun(23);

return 0;   }

Ans: Error

Identify the compiler error in the following code?

#include<stdio.h>

void fun(static int _)

{

printf(“%d”,_);

}

main()

{

fun(23);

return 0;

}

Ans: Error

Identify the compiler error in the following code?

#include<stdio.h>

void fun( extern int _)

{

printf(“%d”,_);

}

main()

{

fun(23);

return 0;

}

Ans: Error

Identify the compiler error in the following code?

#include<stdio.h>

void fun(register int _)

{

printf(“%d”,_);

}

main()

{

fun(23);

return 0;

}

Ans: 23

Identify the compiler error in the following code?

#include<stdio.h>

void fun(typedef int _)

{

printf(“%d”,_);

}

main()

{

fun(23);

return 0;

}

Ans: Error

Identify the error in the following code?
static extern

int a=5;

static int b = 6;

main()

{

printf(“\n%d”,a); printf(“\n%d”,b);

return 0;

}

Ans: 5 6
Identify the error in the following code?

#include<stdio.h>

main()

{

extern int a=5;

printf(“\n %d”,a);

return 0;

}

Ans: 5

Is it possible to declare static function in c language?

Ans: yes it become file scope function

Can we return more than one value by using return statement?

Ans: No

How to return more than one value from a function?

Ans: call by address

Can we use more than one return statement in one function?

Ans: yes

Give an example for function returning void but contains return statement?

Ans:

void abc()

{

printf(“Hello abc”);

return;

}

void main()

{

abc();

}

What is the differences between K&R C style and ANSI C style?

Ans:

K&R-C

int sum(a,b) int a; int b;

{

return (a+b);

}

ANSII-C

int sum(int a,int b)

{

return (a+b);

}

Write a small ‘c’ function to receive any number of arguments?

Read more

Using ASP.NET To Send Email

Using ASP.NET To Send Email

Email is a standout amongst the most well-known and dependable strategies for correspondence for both individual and business purposes. It likewise assumes an essential part in every last Web website. This part will be in the sort of computerized messages from the server in the wake of posting data from a shape. You may have … Read more

Variables in PHP

Variable  is  name of memory location   used  to store some  data. In PHP no need  to provide  data types at the   time of variable  declaration because  PHP is loosely types   language . Variable names start  with  ‘$’ symbol. types of variable in PHP   Local variable :- Variable declaration within  the  function comes under local … Read more