Skip to main content

Posts

Showing posts from 2013

How to find size of array in C/C++ program

#include<iostream> using namespace std; int main() { int a[]={1,2,3,4,5,6,7}; int size; size=sizeof(a)/sizeof(a[0]); cout<<"sizeof a"<<size<<"\n"; system("PAUSE"); return 0; } Output: sizeof a  7 Note : sizeof(a) returns size in bytes and sizeof(a)/sizeof(a[0]) returns number of elements in an array.

Difference between Java and C++

How Java is different from C++ 1.       Java does not support “goto”, “sizeof”, and “typedef” keywords. 2.       Java does not support keywords like “auto”, “extern”, “register”, “signed”, and “unsigned”. 3.       Java does not support any pre-processor like #define, #include. 4.       Java does not support operator overloading. 5.       Java does not support template class. 6.       Java does not support multiple inheritance. 7.       Java does not support global variable. 8.       Java does not support pointers as in C++. 9.       Java replace destructor() function with finalize() method. 10.   There are no header files in Java. 11.   Java is a highly case sensitive language.

Swap two numbers using Pointers in C programming

#include<stdio.h> #include<conio.h> void swap(int*,int*); void main() {   int a,b;   clrscr();   printf("enter first number  :");   scanf("%d",&a);   printf("enter second number :");   scanf("%d",&b);   clrscr();   printf("Before swapping\n\t\ta=%d\n\n\t\tb=%d",a,b);   swap(&a,&b);   printf("\n\nAfter swapping\n\t\ta=%d\n\n\t\tb=%d",a,b);   getch(); }     void swap(int *x,int *y)   {     int z;     z=*y;     *y=*x;     *x=z;    }

Program to print pattern using * (asterik)

Q1 Write a C program to print pattern as below :-     *    ***  ***** ******* #include<stdio.h> #include<conio.h> void main() { clrscr(); for(int i=0;i<4;i++) { for(int j=3;j>i;j--) { printf(" "); //print a space } for(int k=0;k<2*i+1;k++) { printf("*"); } printf("\n"); } getch(); } Q2 Write a C program to print pattern as below :-       *     * *   * * * * *  *  * #include<stdio.h> #include<conio.h> void main() { clrscr(); for(int i=0;i<4;i++) { for(int j=3;j>i;j--) { printf(" "); //print a space } for(int k=0;k<=i;k++) { printf("*"); } printf("\n"); } getch(); }

Use Case Diagram for Online Book Store

Class Diagram of Recycling Machine

Use Case Diagram of Recycling Machine

Use case Diagram of Online Airline Reservation System

Online Movie Ticket Booking Sequence Diagram

Email System Use Case Diagram

Online Shopping Mart Use Case Diagram