Wednesday, 17 January 2018

Count Word Character new line

Q  : Write a Program to count lines, words and characters with a definition that a word is any sequence of characters that does not contain a blank, tab or new line.

Solution :


/*==============================
     Girfa Student Help
     Program : Count Word Character new line
     More Program :http://girfahelp.blogspot.in/p/1.html
================================*/
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main()
{
     FILE *pt;
     char ch;
     int character=0,line=1,word=1;
     clrscr();
     pt=fopen("data.txt","r");

Tuesday, 16 January 2018

Time calculation using function

Q : Write a function that takes time in seconds as input and prints it in terms of hours, minutes and seconds.

Solution : 

/*==============================
     Girfa Student Help
     Program : Time calculation using function
     More Program :http://girfahelp.blogspot.in/p/function-programming.html
================================*/
#include<stdio.h>
#include<conio.h>
void time(int);
void main()
{
     int s,h,m;

Array Average using function

Write a function which accepts an array of size n containing integer values and returns the average of all values. Call the function from main program.

Solution : 

/*==============================
     Girfa Student Help
     Program : Array Average using function
     More Program :http://girfahelp.blogspot.in/p/function-programming.html
================================*/
#include<stdio.h>
#include<conio.h>
#define MAX 5
int avg(int*);

Sunday, 14 January 2018

Array multiply using function

Q :  Write a function which receives two integer arrays and creates a third array by multiplying  corresponding elements (elements with same index) and returns it to main program.


Solution : 

/*==============================
     Girfa Student Help
     Program : Multiply two array using function
     More Program :http://girfahelp.blogspot.in/p/function-programming.html
================================*/
#include<stdio.h>
#include<conio.h>
#define MAX 5
void mul(int *,int *,int *);
void print(int *);
void main()
{

     int ar1[MAX],ar2[MAX],ar3[MAX],i;
     clrscr();
     printf("\nInput f