Wednesday 18 October 2017
Array vs Link List
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Monday 16 October 2017
Matrix Diagonal Sum
Q : Write a ‘C’ program to find out sum of diagonal elements of a matrix using ‘C’.
Solution :
#include<stdio.h>
#include<conio.h>
#define MAX 3
void main()
{
int ar[MAX][MAX],i,j,r,c,sum=0;
clrscr();
for(r=0;r<MAX;r++)
{
for(c=0;c<MAX;c++)
{
printf("Enter
Number>> ");
scanf("%d",&ar[r][c]);
}
}
printf("\n\tOutput\n\n");
for(r=0;r<MAX;
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Saturday 14 October 2017
LATITUDE LONGITUDE Finder
<!DOCTYPE html>
<html>
<head>
<title>Girfa</title>
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?sensor=false&libraries=places"></script>
</head>
<body>
<input id="searchInput" class="input-controls" type="text" placeholder="Enter
a location">
<div class="map" id="map" style="width: 100%; height: 300px;"></div>
<div class="form_area">
<input type="text" name="location" id="location">
<input type="text" name="lat" id="lat">
<input type="text" name="lng" id="lng">
</div>
<script>
/* script */
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Monday 9 October 2017
UGC Net Computer Science Paper 3 Dec 13 Page 7
61. Which of the following is not true with respect to a trackball and/or spaceball ?
I. A trackball is a two dimensional positioning device while as a spaceball provides six degrees of freedom.
II. Unlike the trackball a spaceball does not actually move.
III. A trackball is a three dimensional positioning device while as a spaceball provides six degrees of freedom.
(A) I & II
(B) II & III
(C) II only
(D) III only
62. Which of the following statement(s) is (are) true ?
I. Two successive translations are additive.
II. Two successive rotations are additive.
I. A trackball is a two dimensional positioning device while as a spaceball provides six degrees of freedom.
II. Unlike the trackball a spaceball does not actually move.
III. A trackball is a three dimensional positioning device while as a spaceball provides six degrees of freedom.
(A) I & II
(B) II & III
(C) II only
(D) III only
62. Which of the following statement(s) is (are) true ?
I. Two successive translations are additive.
II. Two successive rotations are additive.
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
UGC Net Computer Science Paper 3 Dec 13 Solved Page 6
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
UGC Net Computer Science December 13 Paper 3 Page 5 Solved
40. Pumping lemma for context-free languages states : Let L be an infinite context free language. Then there exists some positive integer m such that any w ∈ L with |w| ≥ m can be decomposed as
Z ∈ L for all .z = 0, 1, 2, ....... .(A) ≤ m, ≤ 1
(B) ≤ m, ≥ 1
(C) ≥ m, ≤ 1
(D) ≥ m, ≥ 1
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Saturday 7 October 2017
C Language Model Question Set2
C Language
Name : ______________________ Time
:________________
Part 1
Objective
Q 1. Which one of
the following translate or convert high level language program line by line.
A) Translator
A) Translator
B)Compiler
C)Both
D) None
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Friday 6 October 2017
Javascript Random Number
Math.random
function is use to generate random number. It generates a long series of number
less than one or zero. To get random number from a range you need to extract
numbers as your requirement by round-off.
Following
code demonstrate to generate number from 1 to 100.
<html>
<head>
<title>Girfa Student Help : Random Number</title>
<script>
function getRandom()
{
alert(Math.random());
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Thursday 5 October 2017
Timer Java Script
A timer like simulation can be creating using setTimeOut
function which takes two arguments. code and timer interval in Millisecond.
Code run after given time span and if you will call these function in recursive
fashion then you can make a watch.
Timer function Function
<script>
var s=0,m=0,h=0;
function getTimer()
{
s++;
if(s==5) //Minute complete
{
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Tuesday 3 October 2017
UGC Net Computer Science December 13 Paper 3 Page 4 Solved
31. Consider the formula in image
processing
CR is called as compression ratio n1 and n2 denotes the number of information carrying units in two
datasets that represent the same information. In this situation RD is called as relative _________ of thefirst data set.
(A) Data Compression
(B) Data Redundancy
(C) Data Relation
(D) Data Representation
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Monday 2 October 2017
Linear Search VS Binary Search
A linear search works by looking at each element in a list
of data until it either finds the target or reaches the end. This results in
O(n) performance on a given list. A binary search comes with the prerequisite
that the data must be sorted. We can leverage this information to decrease the
number of items we need to look at to find our target. We know that if we look
at a random item in the data (let's say the middle item) and that item is
greater than our target, then all items to the right of that item will also be
greater than our target. This means that we only need to look at the left part
of the data. Basically, each time we search for the target and miss, we can
eliminate half of the remaining items. This gives us a nice O(log n) time
complexity.
Just remember that sorting data, even with the most
efficient algorithm, will always be slower than a linear search (the fastest
sorting algorithms are O(n * log n)). So you should never sort data just to
perform a single binary search later on. But if you will be performing many
searches (say at least O(log n) searches), it may be worthwhile to sort the
data so that you can perform binary searches. You might also consider other
data structures such as a hash table in such situations.
Image Source : https://en.wikipedia.org/wiki/Binary_search_algorithm
Example : Array is best example of linear search and tree
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
CSS 360 Rotation
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Saturday 30 September 2017
C language Paper Solution
NIELIT O Level
C Language Exam paper answer
January-2013
1. Multiple Choice
1.1 : A
1.2 : C
1.3 : A
1.4 : B
1.5 : B
1.6 : C
Explanation : When x will be less than 5 then continue transfer control at top of the loop and increase variable value,check condition. As soon as x get greater than 5 then if return false and control transfer to else . Else has break and when break will execute loop will be stop forcefully.
1. Multiple Choice
1.1 : A
1.2 : C
1.3 : A
1.4 : B
1.5 : B
1.6 : C
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Thursday 28 September 2017
Metric Conversion with structure
Q :Define two structures Metric and British that store distances. The Metric stores values in meters and centimeters and the British stores values in feet and inches. Write a program that reads both structure variables and add values contained in one variable of Metric to the contents of another variable of British. The program should display the result in both: equivalent centimeters and equivalent inches.
Solution :
For solve this question you need to know metric measurement unit.
1 centimeter = 10 millimeters
1 meter = 100 centimeters = 1,000 millimeters
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Wednesday 27 September 2017
Array pass to function
Array is a collection of similar
data type which occupies continuous location on memory. Array’s name is a
constant pointer which point first element of array. So when an array is passing
to a function. Address of first element pass to function instead of value. If any
change made inside of function body with array, then it affects actual value of
passed array. Following program demonstrate this fact.
#include<stdio.h>
int update(int[]);
void main()
{
int arr[5],i;
for(i=0;i<5;i++)
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Monday 25 September 2017
Compilation Process c Language
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
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.
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
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.
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working 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);
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
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;
}
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Sunday 17 September 2017
Average of every third number
Q : Write a ‘C’ program to compute the average of every third integer lying between 1 and 200? Include appropriate documentation?
Solution :
Solution :
#include<stdio.h>
void main()
{
int i,sum,avg;
for(i=1,sum=0;i<=200;i=i+3)
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Saturday 16 September 2017
print a character as per given number
Q : Write a program having function print_char( ) which receives a character and n integer as arguments. The function should print n times the entered character.
Solution :
#include<stdio.h>
void
print_char(char,int);
void main()
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Wednesday 13 September 2017
What is pointer? How is it initialized? What is indirection operator? What is the scale factor
Q : What is pointer? How is it initialized? What is indirection operator? What is the scale factor?
Solution:
Pointer
A pointer is a special type of variable which hold physical address of a non pointer variable.Symbol * is used to make a pointer variable. Programmer can change a variable value from another location with the help of pointer. Call reference is an example of pointer , in which a variable physical address pass to a function and any change made inside of function direct affect actual value of passed variable due to pointer.
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Monday 11 September 2017
Structure C#
namespace
ConsoleApplication1
{
struct School
{
public int roll;
public string name;
public string city;
}
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Sunday 10 September 2017
Explain the working of shorthand assignment operators, pre and post increment operator and the ternary operator.
Q : Explain the working of shorthand assignment operators, pre and post increment operator and the ternary operator.
Solution :
Assignment Operator
Prefix operator
Add or subtract a variable value
by one. There are two types of prefix operator increment and decrement. If use
in any expression or equation then first increment or decrement variable then
solve related equitation with new value of related variable.
int a,b=10;
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Assignment Operator
Question: What is the name = operator in mathematics?
Answer: is equal to
Write In C language terminology this operator is known as
Assignment operator which is use to assign right hand side value into left hand
size variable with overwrite mode. An assignment operator has following
attributes.
- Place right hand side data into left hand side variable.
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Saturday 9 September 2017
Vowel count separately Program
Q : Write a program to calculate number of vowels (a,e,i,o,u) separately in an entered string.?
Solution :
#include<stdio.h>
void main()
{
int a,e,i,o,u,index;
char str[50];
a=e=i=o=u=0;
printf("Enter string>>
");
gets(str);
for(index=0;str[index]!='\0';index++)
{
switch(str[index
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Thursday 7 September 2017
CSS Media Query
<html>
<head>
<title>@Media Query Girfa</title>
<style>
.container h1
{
margin-top:15%;
font-size:4em;
line-height:
1.2em;
text-transform:
uppercase;
font-weight:
bold;
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Wednesday 6 September 2017
Identifier C Language
Identifier is user defined name given to function, variable, structure, union, array etc. followings are rules to name an identifier.
- Name must be start with alphabet or underscores
- An identifier may have numbers but not used as first c
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Saturday 2 September 2017
M3-R4: PROGRAMMING AND PROBLEM SOLVING THROUGH ‘C’ LANGUAGE July- 2013 Answer
M3-R4: PROGRAMMING AND PROBLEM SOLVING THROUGH ‘C’ LANGUAGE July- 2013, Answer
1. Multiple Choice
1.1 : D
Explanation : Smallest individual unit of program is known token. Eg.
(,},1,A,;
1.2 : A
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Friday 1 September 2017
Jquery to PDF Generator
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Thursday 31 August 2017
Preprocessor Directive
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Computer Fundamental MCQ CCC
CCC Fundamental MCQ/True-False Question with Answer
Multiple Choice
1. How many types of memory used in computer?A) 1
B) 2
C) 3
D) 4
2. Which Type of memory got outdated?
A) PROM
B)EEPROM
C)CD
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Wednesday 23 August 2017
Command Line Argument
C language is known as a language of building block of
function. It means all the things achieved by the language using function.
A function is a set of some valid statements of language. Which
achieved some specific task? You need to know some information about function
before using it.
- Function name
- Return type
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Tuesday 22 August 2017
Print Some Character from a File
Q : Write a ‘C’ program to print only first 12 characters including blank space from file test.txt.
Solution :
Solution :
#include<stdio.h>
#include<conio.h>
void main()
{
FILE *pt;
int i;
char ch;
pt=fopen("test.txt","r");
if(pt==NULL)
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Structure size without sizeof operator
Q : Write a ‘C’ program to find size of structure without using sizeof operator.
Solution :
#include<stdio.h>
typedef struct stu
{
int roll;
char
name[20];
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Subscribe to:
Posts (Atom)