Thursday 2 February 2017

Link List Count Function

NIELIT O Level Solved Paper
January 2016

Q 9 B. Define the structure of a node of a singly linked list and use it to write a function to count the
number of nodes in a singly linked list. The function should accept a pointer to the first node of
the list and it should return the number of nodes in the list.

Solution : 

/*   ************************************************
           Girfa : Student Help
           Counting node in link list
           for more program visit : http://girfahelp.blogspot.com/p/c-language-assignment.html
     *************************************************/

Wednesday 1 February 2017

Simple Triangle C Language

Simple Triangle C Language Code

While Loop Implementation :

#include<stdio.h>
void main()
{
     int i,j;
     i=1;
     while(i<=5)
     {
           j=1;
           while(j<=i)
           {
                printf("*");
                j++;
           }
           printf("\n");
           i++;
     }
}

Monday 30 January 2017

C Language Structure Record Entry

NIELIT O Level Solved Paper
January 2016
C Language

Q8 b) Write a program to create a structure Employee having empCode, name, department, address and salary as its members. Read the details for 10 employees and then display them.

Solution : 

#include<stdio.h>
#include<conio.h>
struct stu
{
     int empcode;
     char name[20];
     char dept[20];
     char address[20];
     int sal;

};

Factorial number with recursion

NIELIT O Level Paper
C Language
 January 2016 Solved

Q8 a) Write a program having a recursive function to calculate the factorial of a number. In the main() function, read the value of the number and then using the recursive function display the result.

Solution :

/*   ################################
     Girfa Student Help
     Factorial recursion  program
     for more visit : http://girfahelp.blogspot.in/p/c-language.html
     ################################