Sunday, 14 January 2018

Palindrome number

 Q : Write a program which asks for a integer from the user. It reverses the integer and prints “same” if after reversal the number is same as old number otherwise it prints “not same”.

Solution : 

/*==============================
     Girfa Student Help
     Program : Reverse a number
     More Program :http://girfahelp.blogspot.in/p/loop-c-language.html
================================*/
#include<stdio.h>
#include<conio.h>
void main()
{

     int n,m,r=0;
     clrscr();
     printf("Enter number>> ");
     scanf("%d",&n);
     m=n;
     while(n>0)

Saturday, 13 January 2018

Table as parameter SQL Server

Table as parameter SQL Server

SQL Server provides a special parameter named table parameter. Using table parameter user can pass entire table as other parameter pass to store procedure. Table parameter is better alternate of temporary table. It reduces unnecessary work and time. Which need to pass more than one row to database for save.

Table Structure


Field Name
Data Type
Roll
Int
Name
Varchar(30)
City
Varchar(40)

Store Procedure

Table Type


CREATE TYPE dbo.myDataType AS TABLE  
( roll int, 
  name varchar(30),
  city varchar(30)
 );  

Thursday, 11 January 2018

Average in dynamic structure

Q :  Write a program which asks the user to enter the name and age of persons in his group.The number of persons is not known to the user in the beginning of the program. The user keeps on entering the data till the user enters the age as zero. The program finally prints the average age.

Solution :


/*==============================
     Girfa Student Help
     Program : Age calculation in dynamic structure
     More Program : http://girfahelp.blogspot.in/p/c-language-structure-programming.html
================================*/
#include<stdio.h>
#include<conio.h>
typedef struct stu
{
     char name[20];
     int age;

Forgot & in scanf