Posts

Rand function in c language (useful for random number generating game )

  #include <stdio.h> #include <stdlib.h> int main(void) { // This program will create same sequence of // random numbers on every program run for(int i = 0; i<5; i++) printf(" %d ", rand()); return 0; }

FUNCTION OVERRIDING IN CPP

  #include<conio.h> #include<iostream> using namespace std; class overriding {     int age;     public:          void over(){         cout<<"Enter your age :"<<endl;         cin>>age;         cout<<"Age: "<<age;              } }; class override{       char name[20];       public:       void over(){                cout<<"Enter your name "<<endl;     cin>>name;     cout<<"Name :"<<name; }       }; int main(){     overriding obj1;     obj1.over();          override obj;     obj.over();           return 0;      }

GYM HOME

Image
  Lakshman's Fitness Home   About Us   Services   Whatsapp   Blog Email Now   Sign Up These days is 60% off join Pune Gym now Submit Now

About gym

  This is the website whereby you can register yourself and you can join the gym of Pune. It is the best gym in All Pune. After joining this gym. You will show that yes I have developed my body personality.

write a program to print tribonacci series in c language

  // A simple recursive CPP program to print // first n Tribonacci numbers.  #include<stdio.h>  #include<conio.h>   int printTribRec(int n) { if (n == 0 || n == 1 || n == 2) return 0; if (n == 3) return 1; else return printTribRec(n - 1) + printTribRec(n - 2) + printTribRec(n - 3); } void printTrib(int n) { for (int i = 1; i < n; i++) printf("\n%d  ",printTribRec(i)); } // Driver code int main() { int n = 30; printTrib(n); return 0; }

write a program to calculate total and average marks of 5 subjects

  ** * C program to calculate total, average and percentage of five subjects */ #include <stdio.h> int main() { float eng, phy, chem, math, comp; float total, average, percentage; /* Input marks of all five subjects */ printf("Enter marks of five subjects: \n"); scanf("%f%f%f%f%f", &eng, &phy, &chem, &math, &comp); /* Calculate total, average and percentage */ total = eng + phy + chem + math + comp; average = total / 5.0; percentage = (total / 500.0) * 100; /* Print all results */ printf("Total marks = %.2f\n", total); printf("Average marks = %.2f\n", average); printf("Percentage = %.2f", percentage); return 0; }

write a program to check year is leap year or not

  #include <stdio.h> int main () { int year ; year = 2016 ; if ((( year % 4 == 0 ) && ( year % 100 != 0 )) || ( year % 400 == 0 )) printf ( "%d is a leap year" , year ); else printf ( "%d is not a leap year" , year ); return 0 ; }