Skip to main content


Showing posts from May, 2015

Print the Truth Table

#include<stdio.h> int OR(int,int); int AND(int,int); int XOR(int,int); int NOT(int); void main() { int a,b,ch,o; printf("\n-:MENU:-\n1.AND\n2.OR\n3.NOT\n4.XOR\n0.Exit\n"); do{ printf("\nEnter Choice:"); scanf("%d",&ch); switch(ch) { case 1: printf ("\nTruth Table for AND\nA B \tO"); for(a=0;a<=1;a++) { for(b=0;b<=1;b++) { o=AND(a,b); printf("\n%d %d \t%d",a,b,o); } } break; case 2: printf ("\nTruth Table for OR\nA B \tO"); for(a=0;a<=1;a++) { for(b=0;b<=1;b++) { o=OR(a,b); printf("\n%d %d \t%d",a,b,o); } } break; case 3: printf ("\nTruth Table for NOT\

Simple Interest

#include<stdio.h> void main() { float p; float ir,t; float in; printf("Principle amount : "); scanf("%f",&p); printf("\nInterest : "); scanf("%f",&ir); printf("\nTime (in year) : "); scanf("%f",&t); in=p*ir*t/100; printf("\nYou will get interest : Rs. %.2f",in); } Output   Print   Download Code Output Principle amount : 5000 Interest : 10 Time (in year) : 3 You will get interest :Rs. 1500.00

Print the Multiplication Table

#include<stdio.h> void main() { int x=1,num,res; printf("Enter a Number : "); scanf("%d",&num); while(x<=10) { res=num*x; printf("\n%d x %d = %d",num,x,res); x++; } } Output   Print   Download Code Output Enter a Number : 6 6 x 1 = 6 6 x 2 = 12 6 x 3 = 18 6 x 4 = 24 6 x 5 = 30 6 x 6 = 36 6 x 7 = 42 6 x 8 = 48 6 x 9 = 54 6 x 10 = 60

Find the Greatest of Three Numbers

#include<stdio.h> void main() { int x,y,z; printf("Enter values of x, y and z : "); scanf("%d,%d,%d",&x,&y,&z); if(x>=y && x>=z) printf("\n%d is greatest",x); else if(y>=z) printf("\n%d is greatest",y); else printf("\n%d is greatest",z); } Output   Print   Download Code Output Enter values of x, y and z : 4, 9, 2 9 is greatest

Swap two Numbers

#include<stdio.h> void main() { int x,y,z; printf("Enter Values x and y : "); scanf("%d%d",&x,&y); z=y; y=x; x=z; printf("\nValue of x=%d",x); printf("\nValue of y=%d",y); } Output   Print   Download Code Output Enter Values x and y : 5 4 Value of x= 4 Value of y= 5

Sum of two numbers

#include<stdio.h> void main() { int a,b,sum; printf("Enter Numbers a and b : "); scanf("%d %d",&a,&b); sum=a+b; printf("\n%d + %d = %d",a,b,sum); } Output   Print   Download Code Output Enter Numbers a and b :5 4 5 + 4 = 9

Print "Hello, World!" without semicolon

Solution: 1 #include<stdio.h> void main(){ if(printf("Hello world")){ } } Solution: 2 #include<stdio.h> void main(){ while(!printf("Hello world")){ } } Solution: 3 #include<stdio.h> void main(){ switch(printf("Hello world")){ } } Output   Print   Download Code Output Hello, World!

Accept Name, Age from User and Print them on the Screen

#include<stdio.h> int main() { char nam[20]; int age; printf("Enter Your Name : "); scanf("%s",&nam); printf("Enter Your Age : "); scanf("%d",&age); printf("\nYour Name is %s ",nam); printf("and your age is %d",age); return 0; } Output   Print   Download Code Output Enter Your Name : Sumit Enter Your Age : 21 Your Name is Sumit and your age is 21


Normalization is the process of splitting relations into well-structured relations that allow users to insert, delete, and update tuples without introducing database inconsistencies. The focus of normalization is to reduce redundant data to the minimum.  Normalization is also called “Bottom-up approach”, because this technique requires very minute details like every participating attribute and how it is dependant on the key attributes, is crucial. If you add new attributes after normalization, it may change the normal form itself. Through Normalization, the collection of data in a single table is distributed into multiple tables with specific relation. Without normalization many problems can occur when trying to load an integrated conceptual model into the DBMS. These problems arise from relations that are generated directly from user views are called anomalies. There are three types of anomalies: RollNo StudentName CourseNo CourseName Instructor 120 SKL CS-7

Earthquake - Do's and Don'ts

A. Before an earthquake: • Follow and advocate local safe building codes for earthquake resistant construction. • Follow and advocate upgrading poorly built structures. • Make plan and preparation for emergency relief. • Identify the medical centres, fire fighting stations, police posts and organise relief society of your area. • Know the electric and water shut off locations in your house. • Heavy objects, glasses, cutlery should be kept in lower shelves. • Flower pots should not be kept on the parapet. B. During an earthquake: • Keep calm and reassure others. • During the event, the safest place is an open space, away from buildings. • If you are indoors, take cover under a desk, table, bed or doorways and against inside walls and staircase. Stay away from glass doors, glass panes, windows or outside doors. Do not rush to go out of the building, to avoid stampede. • If you are outside, move away from buildings and utility wires. • Once in the open, stay there till the vibrations stop

Now Send mp3 via WhatsApp for Windows Phone

WhatsApp getting ready for Windows 10

WhatsApp today released an update for the Beta version . Primarily the update looks like a Bug Fix update. But while Tech enthusiasts dig into the deep, the update suggests that WhatsApp is getting ready for Windows 10. Notification panel for WhatsApp v 2.11.688 on Windows 10 Notification panel for WhatsApp v 2.12.20 on Windows 10 There are four visible changes. Firstly one of the major feature WhatsApp for Windows Phone was missing for a long time. Now we can attach Audio mp3 files and send it via WhatsApp. Secondly, while sending text there is a cool animation for the chat bubbles. There is another cool new feature to select multiple chats and delete or archive the. And lastly there is a toggle button to enable or disable read receipt in the Privacy Settings. There is a significant change in the version number. While writing this the Public version is 2.11.688, while the Beta version is 2.12.20. I though this version must have the most awaited calling feature. But there is no trace