Friday 11 August 2017

Array of structure

Q: Define a structure of student with the following fields: rollNo, name and marks. Write a program to read and store the data of at most 30 students in an array. Also display the average marks of
the students.

Solution : 


#include<stdio.h>
#define MAX 3
typedef struct Stu
{
     int roll;
     char name[20];
     int mark;
}student;

IDENT_CURRENT SQL Server

IDENT_CURRENT returns newly inserted record‘s auto increment value. So you can use this data while inserting a record it can be useful in many times. For example you want to return newly inserted record is for other task etc.


 USE [girfa]
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:        Raj Kumar
-- Create date: 08-Aug-2017
-- Description:   Girfa Student Help
-- =============================================
alter PROCEDURE [dbo].[adddata]

Vowel Count Switch statement

Q : using a switch statement, write a function to count the number of vowels and number of blanks
in a character array passed to it as an argument.

Solution 



#include<stdio.h>
#define MAX 20
void count(char*);

Prime number in given range

Q : Write a program to display all the prime numbers between two positive integers m and n. The values of m and n are to be taken from the user.

Solution : 


#include<stdio.h>
void main()
{
     int n,m,p;
     printf("Enter range starting number>> ");
     scanf("%d",&m);