Thursday, 16 July 2020

POW function | C Language

Q : Write a function fnpow() in C to compute xy where x is float and y is integer. Function will return the result and takes x, y as arguments.

Answer :

#include<stdio.h>
#include<conio.h>
/*============================
     Girfa Student Help
     User defined pow function
==============================*/

Wednesday, 15 July 2020

Difference between Union & Structure


SN.
Structure
Union
1
Struct keyword is used to make structure variable
Union  keyword is used to make structure variable
2
Structure is user defined data type which is used frequently to represent real word data type presentation.
Union is also a user defined data type which is used to achieve specific need.
3
Structure allocates memory for its all member.
Union allocates memory only for the biggest data member.
4
All member data can be hold at same time in a structure variable.
Only one data from member can be hold at a time.
5
Several members can be initialized at ones.
Only first member can be initialized.


Tuesday, 14 July 2020

File writing program append mode using Command Line Argument

Q : Write a program using command line parameters to append one text file to another text file.?


Answer : 



#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
void main(int argc,char *argv[])
{
     FILE *infile,*outfi

Monday, 13 July 2020

Bitwise Operator Complete solution

Bitwise operators are used to perform bit operations. Decimal values are converted into binary values which are the sequence of bits and bit wise operators work on these bits. Bit wise operators in C language are given below.

1. & (bitwise AND)
2. | (bitwise OR) 
3. ~ (bitwise NOT)
4. ^ (XOR)
5. << (left shift) 
6. >> (right shift).