Friday, 10 July 2020

Element delete program from array | C Language

Q :  Write a program that accept an array of 10 integers and a number to be deleted from the array if found. Represent deleted element with -1 and display final array. If not found print appropriate message.


Answer :

#include<stdio.h>
#include<conio.h>
/*============================
     Girfa Student Help
     Delete operation in array
==============================*/
void main()
{

Tuesday, 7 July 2020

Get single row from MYSQL | PHP

Get a single row for editing or another purpose from MySql using PHP.



$conn=mysqli_connect("localhost","root","","girfadb");
$sql="select   name, phone  FROM  stu where  id=101";
$row=$conn->query($sql)->fetch_assoc() or die("<h1>Error</h1>". mysqli_error($conn));
echo $row['name'];
echo $row['phone'];
mysqli_close($conn);

Monday, 6 July 2020

Record input and search program structure | C Language

Q : Write a ‘C’ program to read following details of 50 students.
      Student Name, Student Roll No, Class 
 Display total number of students studying in class “BCA”.

Answer : 



#include<stdio.h>
#include<conio.h>
#include "mylib.h"
/*============================
     Girfa Student Help
     Structure entry & search count
==============================*/
struct data
{
     int roll;
     char name[20];
     char cls[50];
};

Sunday, 5 July 2020

Change/return more than value from function | C Language

Q : Write down three different methods used for referencing multiple values from a function.


Answer : you can return only one value from function using return statement but you can change multiple values from a function using a pointer, array, and structure. The following program will show you a demo. 




#include<stdio.h>
#include<conio.h>
#include "mylib.h"
/*============================
     Girfa Student Help
     Multiple value set from function
==============================*/
struct data
{
     int roll;
     int marks;
};