Sunday 24 September 2017

Sum of series using recursion

Q : Define recursion. Write a complete program to evaluate the given series using recursive function sum( ). Here n is user dependent.
1 + 2 + 3 +…+ n

Solution : 

As we C language is known as building block of functions. This means everything in c language is achieved through a function. In C language there is not any restriction to call a function you can call a function from anywhere No matter of scope.

Friday 22 September 2017

File Open close

Q : How to create a file in C? Why should a user close the file?

Answer : 


For create a file in language,stdio.h header file has fopen method which takes two arguments and return base address of opening file.

Suntax

Return_address  fopen(“file name”,”Open mode”);

Open mode indicate file opening option whether a file is open for read, write, append or both.

Wednesday 20 September 2017

Single link list upto 20 number

Q : Write a program to create a link list. There should be 20 nodes in the list, each node contains an integer between 1-20. The list should be printed at the end.


Solution : 

#include<stdio.h>
typedef struct nlist
{
     int data;
     struct nlist *next;
}node;
node *start=NULL;
node* create(int);
void add(int);

Tuesday 19 September 2017

Combine multiple css link into single link

A website has more than external css file which must be reference on page where it has to use. When a lot number of css file being used it increase complexity for web developer because of add many external link.


So for sake of simplicity of your web page. You can use @import. Which help you to add more than one external css file referenced by a single line? You need to add all your external css file reference into a single css file. Add this file link to your web page and enjoy compress coding….

CSS File


file1.css


h1
{
     color:red;
}