Tuesday 24 June 2014

46)write a program to evaluate the difference between bool and int data type.

#include<iostream>
using namespace std;
int main()
{   int k=10;
   int x;
   bool z;
    z=k<15;
    x=k<4;
    x=5;
   // x=5;
    //cout<<sizeof(x)<<endl<<sizeof(z)<<endl;
    cout<<"value of z"<<z<<endl<<"value of x"<<x;
    int i;
    cin>>i;
    return 0;
}

No comments:

Post a Comment

Write a program which reads a set of integers into an integer array and then prints "YES"if all of them are same otherwise print "NO".

#include<stdio.h> int main() { int a[10],M=0,i,n; printf("enter a value for n\n"); scanf("%d",&n); fo...