Tuesday, February 28, 2017

work sheet 1-03-2017 for 2nd cse-1

1)                  What will the out put of the following
               int main()
                {
                                int i=5;
                                i=++i+i+++i++;
                                printf("\n%d",i);
                }
a)20    b)24   c)21   d)none

2)       int main() {
        Printf(“%d %d %d”,sizeof(3.14F),sizeof(3.14),sizeof(3.14L));
a)4,8,8   b)4 4 4    c)4 8 10    d)4 4 10

3) int main()
                {              int x=10;
                printf("\n%d %d   %d",x++,++x,x++,x=sizeof(x));
                }
a)10 11 12  b)3 4 4  c) 4 4 2   d)none

4) int main()
                {
                                printf("\n%d",sizeof(1F));
                }
a)8  b)2   c)4   d)none

5) int main()
                {
                char ch='07'+1;
                printf("\n%d",ch);
                }
a)1   b)49   c)08   d)8

6) void main()
{int a,b;
a=1,3,5;
b=(1,4,5),(1,2,3);
printf("%d",a+b);
}
a)6    b)2   c)4   d)8
7) void main()
{
int a=4,b=6;
if(++a==--b && 1)
printf("\ntrue");
else;
printf(" false");
}
a)true   b)false   c)true false  d)error

8) void main()
{
int ch='0';
switch(ch)
{
case 0:  printf("0 is a number"); break;
case 48:printf("\n0 ascii val is 48");
}}
a)0 ascii val is 48   b)error   c)0 is a number  d)none
9) void main()
                {           while(1,2,'a',0)
                                {
                                                printf("abc");
                                }
                                printf(" def");
                }

a)abc def   b)error   c) def   d)abc abc abc def

10) void main()
                {
                                int i=1;
                                for(;i++<=5;printf("%d,",i));
                }

a)2,3,4,5,6   b)1,2,3,4,5   c)error   d)1,2,3,4

11)main()
{
                Char*str=”Chennai”;
                Printf(“\n%s”,str,*(++str));
}
a)Chennai   b)hennai    c)C   d)none

12)  int  main()
{
   no[3][3]={{1,2,3},{3},{0}};
printf(“\n%d”,0[no[1]]);
}
a)3   b)0   c)error   d)2
13) main()
{
                char  n1[6]={‘a’,’b’,’c’};
char  n1[7]={‘a’,’b’,’c’};
puts(n1);
puts(n2);
}
a)abc      b)abc     c)abc abc   d)none
   abc                        abc
14)
main()
{
                Char str[]=”ongole\0town”;
                Printf(“\n%d”,sizeof(str));
}
a)6    b)7     c)11     d)10
15)main()
{
                Int no[]={10,20,30,40,50};
Printf(“\n%d”,*n,*(n++),*(--n));
}
a)10  b)error    c)20   d)0
16)
main()
{
                Int  no[]={!0,20,30};
                Int  *n;
               n=&no+2;
printf(“\n%d”,*n);
}
a)12  b)30   c)error   d)10
17)main()
{
                printf(“\n%8.4s”,”RISE_OGL”);
}
a)         RISE     b)RISE_OGL    c)RISE_   d) error

18) # include <stdio.h>
                void main()
                {
                                char *str;
                                                clrscr();
                printf("%d",strlen(strcpy(str,"str")));
                }
a)error    b)3    c)0   d)error






5G Wireless Technology Specifications Announced; 20Gbps Download Speeds, 1ms Latency

5G Wireless Technology Specifications Announced; 20Gbps Download Speeds, 1ms Latency


Earlier this month, it was confirmed the 5G will be the official successor to 4G wireless communications as the fifth generation mobile wireless communications technology. The name as well as the new official logo were announced by 3GPP cellular standards group. Apart from announcing that 5G will be IoT-focused, 3GPP did not go into the finer details. Now, some specifications have been provided by the International Telcommunication Union (ITU) that need to be met in order for networks to be deemed 5G-capable.
ITU lists minimum requirements for peak data rate, spectral efficiencies and target values for both downlinks and uplinks (in the Dense Urban – eMBB test environment):
Downlink peak data rate is 20Gbps
Uplink peak data rate is 10Gbps
Downlink peak spectral efficiency is 30 bits per second per Hz
Uplink peak spectral efficiency is 15 bits per second per Hz
Downlink user experienced data rate is 100Mbps
Uplink user experienced data rate is 50Mbps
20Gbps download capacity is pretty significant when compared to current 4G LTE Cat. 16 modems that are around 1Gbps. Furthermore, ITU’s report states that IMT-2020, or 5G, must support at least 1 million connected devices per square kilometre, which points mainly to IoT. 5G will require carriers to have at least 100MHz of free spectrum, and up to 1GHz where available. The 5G specs also require base stations that can support access from 0kmph up to 500kmph vehicular speed.
5G networks are expected to offer users a maximum latency of just 4ms. Current gen 4G LTE networks give around 20ms latency. 5G also calls for a latency of just 1ms for ultra-reliable low latency communications (URLLC).
ITU’s report is still in its initial stage and will need to be finalised (likely in November) before work on bulding 5G tech begins. Some companies like Verizon, AT&T, Intel, and Qualcomm have already begun testing 5G technology. The next-gen wireless network will also be in focus during the upcoming MWC 2017.

Sunday, February 26, 2017

II nd CSE - I RPRA Work sheet....

work sheet on casting...
----------------------------------------
 1) Accept two integers and print sum,avg and
       difference.
main(){
int n1,n2,sum,diff;
float avg;
printf("\nEnter  two  integers?");
scanf("%d%d",&n1,&n2);
sum=n1+n2;
  printf("\nSum = %d",sum);
avg=(float)(n1+n2)/2;  /* explicit casting */
printf("\nAvg = %f",avg);
diff=fabs(n1-n2);
printf("\nDiff  = %f",fabs( (double)(n1-n2) )  );
}
 2)   Accept a floating point value and print only the
       dec part
    ex: -  i/p 10.345     o/p   0.345  only

main(){

float   fval , dec;
printf("\nEnter a float val ?");
scanf("%f",&fval);
dec=fval-(int)fval;
printf("\ndec part = %10.3f",dec);

}


  3)   accept   a 4 digit number only
        and test the number is
        4 digit number or   not?

int num;
int
printf("\nEnter  A  Number ?");
scanf("%d",&n1);
n1>=1000 && n1<=9999 ? printf("\n 4 digit number.."):
printf("\n not  a 4 digit number..");

work sheet if /nested if
---------------------------------------------------------------------
1) Swap two variable values with out using 3rd variable
2)Accept two integers and print absolute difference
    Hint: diffrence must be +ve (use abs() function )
3) Accept 4 digit year and print leap year or not
4)Accept 3 subject marks of student and print division
    >=70%   ---- distinction
    >=60%  ----- first
    >=50% ------ pass other wise fail
5) Accept a 4 digit number and print digit sum.
    Hint: use operators only
6) Accept a char and print in alternate case
7) Accept 3 integers and print second maximum
8)Accept a floting point value and print only the decimal part
    Hint : Example i/p   is  10.345        o/p  is  0.345
    Do in this order :   1  , 2 , 6 , 8 ,3 .....

9)Check Whether a Number is Even or Odd
10)Check Whether a Character is Vowel or consonant
11)Find the Largest Number Among Three Numbers Entered by 

User
12) Find all Roots of a Quadratic equation
13)Check Whether the Entered Year is Leap Year or not
14)Check Whether a Number is Positive or Negative or Zero.
15) Checker Whether a Character is an Alphabet or not
16)Find HCF of two Numbers
17)Find LCM of two numbers entered by user


/* work sheet on goto */
---------------------------------------------------------------------
1) print A B C D .... Z
2) print A B B C C D.....upto Z
3) print n'th table
Ex:-e
10 x 1 =10
10 x 2 =20
10 x 3 =30
...............
10 x 10 =100

/* work sheet on loops */
---------------------------------------------------------------------
1) program to print 10 to 1
2) print a....z
3) print fib series   0,1,1,2,3,5....
4)program to print sum of 10 integers
5) program to print first n numbers sum..
    10 number sum is 55
6)print 5 4 3 2 1 0 1 2 3 4 5
7) accespt a number and print digit sum use loops
8)Accept a number and  test wether a number is prime number or 

not

9)Find Sum of Natural Numbers
10)Find Factorial of a Number
11)Generate Multiplication Table
12)Count Number of Digits of an Integer
13)Reverse a Number
14)Calculate the Power of a Number
15)Check Whether a Number is Palindrome or Not
16)Check Whether an Integer is Prime or Not
17)Display Prime Numbers Between Two Intervals
18)Check Armstrong Number
19)Display Armstrong Number Between Two Intervals
20)Display Factors of a Number
21)Print Pyramids and Triangles in C programming using Loops
    different patterns
    
22)Make a Simple Calculator to Add, Subtract, Multiply or 

Divide Using switch...case

Saturday, February 18, 2017

Practice Paper in C for II-CSE RGAN

Menu Driven Mini Project in C For II-CSE-I RGAN [ 27-01-2017 to 18-02-2017 ]


    # include <stdio.h>
    # include <conio.h>
    # include <stdlib.h>


    char ch;
    FILE*f;
    /* student struct */
    struct  Student
    {
        int sno;
        char sname[15];
    };


    line(int col,int row,int color,int width)
    {
        int i;
        textcolor(color);
        gotoxy(col,row);

        for(i=1;i<=width;i++)
        {
        putch(219);
        }

    }


    menu()
    {
        clrscr();
        line(30,8,3,18);
        line(30,20,3,18);
        textcolor (YELLOW);
        gotoxy(30,10);
        cprintf("1....AddRec");
        gotoxy(30,11);
        cprintf("2....DisRecs");
        gotoxy(30,12);
        cprintf("3....Record Count");
        gotoxy(30,13);
        cprintf("4....Get Rec By Sno");
        gotoxy(30,14);
        cprintf("0....E X I T");
        gotoxy(30,18);
        textcolor (YELLOW+BLINK);
        cprintf("Choice?");
        textcolor (YELLOW);
        scanf("%c",&ch);

    }

    addrec()
    {
        struct Student s;
        gotoxy(30,22);
        cprintf("Enter student NO?");
        scanf("%d",&s.sno);
        gotoxy(30,23);
        cprintf("Enter student Name?");
        scanf("%s",&s.sname);

        /* ADDING REC */
        f=fopen("c:\\student.dat","a");
        if(f==NULL)
        {
            perror("\nUnable to open File for adding Record");
            return -1;
        }

        fwrite((struct Student*)&s,sizeof(struct Student),1,f);
        fclose(f);
        gotoxy(30,24);
        cprintf("Recod Added to Database.....");

    }

    disrecs()
    {
        struct Student s;
        gotoxy(30,22);
        cprintf("All Student Details....");
        /* displaying all  RECs */
        f=fopen("c:\\student.dat","r");
        if(f==NULL)
        {
            perror("\nUnable to open File for extracting Records");
            return -1;
        }

        fread((struct Student*)&s,sizeof(struct Student),1,f);
        while(!feof(f))
        {
        printf("\n%5d\t%15s",s.sno,s.sname);
        fread((struct Student*)&s,sizeof(struct Student),1,f);
        }
        fclose(f);
    }

    fileinfo()
    {
        int fs,rs,recs;
        gotoxy(30,22);
        cprintf("Fileinformation");
        f=fopen("c:\\student.dat","r");
        if(f==NULL)
        {
            perror("\nUnable to open File for extracting Records");
            return -1;
        }
        /* finding file size  & record size*/
        rs=sizeof(struct Student);
        fseek(f,0,SEEK_END);  /* position file poi at end */
        fs=ftell(f);
        recs=fs/rs;
        printf("\nFile size = %d",fs);
        printf("\nRec  size = %d",rs);
        printf("\nRecords   = %d",recs);
        fclose(f);


    }
    getrecbysno()
    {
        int sno;
        struct Student s;
        gotoxy(30,22);
        cprintf("\nEnter Sno to Ge?");
        scanf("%d",&sno);
        f=fopen("c:\\student.dat","r");
        if(f==NULL)
        {
            perror("\nUnable to open File for extracting Records");
            return -1;
        }
        /* searching */
        fread((struct Student*)&s,sizeof(struct Student),1,f);
        while(!feof(f))
        {
            if(sno==s.sno)
            {
            printf("\n%5d\t%15s",s.sno,s.sname);
            break;
            }
        fread((struct Student*)&s,sizeof(struct Student),1,f);
        }
        fclose(f);
    }

    main()
    {
        do
        {
        menu();
        switch(ch)
        {
            case '1':
                    addrec();
                    break;
            case '2':
                    disrecs();
                    break;
            case '3':
                    fileinfo();
                    break;
            case '4':
                    getrecbysno();
                    break;

            case '0':
                exit(0);
        }
        getch();
        }while(ch!='0');
/*  over */
    }

Friday, February 10, 2017

C-Program To find SET bits

/*  C-Program To find SET bits   */
main()
{
int count,x=7;

for ( count=0; x != 0; x>>=1)
{
if ( x & 1)
count++;
}

printf("%d", count);
}

Sunday, February 5, 2017

[ TT C Test ] Date : 05-2-2017 II CSE SECTION 1



05-2-2017    II   CSE   SECTION 1 ( 30q each 1 mark)   [ Compiled by RVS@RISE ]

1)
main(){
printf("%d  %d   %d",sizeof(400L),sizeof(400)
,sizeof(400.0));
a)4 2 8     b)2  2 4      c)2 2 8     3)error

2)
char ch='xy';
val of ch is?
a)y         (b)x            c)none      d)NULL

3)
main()
{
int x;
x=10,20,30;
printf("%d",x);
}
a)30   b)20    c)10   d)error;
4)
main()
{
int a=117;
printf("%x",a);
}
a)75     b)117   c)error   d)0
5)
main(){
enum    bykes{suzuki,honda=3,hero};
printf("%d",suzuki+hero);
}
a)4       b)2       c)6     d)error
6)
Main()
{
int a=3,b=7,c;
c=a==b==1;
printf("%d",c);  
}
a)1           b)0        c)3      d)7
7)
#  define max (a,b)    a/b
Main() {
Printf(“\n%d”,max(10,3));
}
a)      3   b)3.333  c)3.333333  d)error


8) .what will be the output of the program?
#include<stdio.h>
int main()
{
    int k, num = 30;
    k = (num < 10) ? 100 : 200;
    printf("%d\n", num);
    return 0;
}
a)200    b)30    c)100     d)500

9).what are the invalid identifiers?
a.DOUBLE
b.Int
c.Float
d.all above


10) what will be the output of the program?
void  main()
{
int x;
x=015+0x71+5;
printf(“%d”,x);
}
a.13
b.131
c. compiler error
d.9

11). float f=10.3456F; int x=f;
 what was the value of x?
A.  10.3
B.  10
C.  10.345
D.  10.346

12)
int i=5; 
int j; 
j=++i + ++i + ++i; 
printf("%d",j);
A.  21
B.  18
C.  24
D.  15

13). 
int a=0,b=1; 
if(a=0)
 { printf("\ntrue"); }
 else
 { printf("\nfalse"); }
A.  none
B.  true
C.  syntax error
D.  false
14)
printf(" %d %d %d",sizeof(3.14) , sizeof(3.14F), 
sizeof(3.14L));
A.  8 4 10
B.  4 4 4
C.  8 8 8
D.  4 4 10
9
15)which of the following are unary operators
 1. !     2. sizeof      3. ~        4. &&
A.  1,2
B.  1,3
C.  1,2,3
D.  2,4

16)char f=255; f++; printf("%d ",sizeof(f));
A.  2
B.  4
C.  compilation error
D.  1
17)
int a; a=sizeof(!5.6); printf("%d",a);
A.  2
B.  4
C.  10
D.  8
18)
void main()
{
            float x=10.2345F;
            int a;
            clrscr();
            a=x-(int)x;
            printf("\n%f",(float)a);
}
a)10.234500                b)0.000000                  c)error                         d)10.2345

19) 3.#include<stdio.h>
void main()
{
            int ch=NULL || EOF+1 && EOF ;
            clrscr();
            printf("%d",ch);
}
a)0       b)1       c)-1      d)48
20)
12. #include<stdio.h>
void main()
{
            int a=5^8;
            printf("%d",a*a);
}
a)13     b)169   c)-169  d)-13
21)
#include <stdio.h>
        int main()            {
                        if(1)
                        if(0);
                        else if(1)
                        printf("\nOver");
                        else;
        }
a)Over b)syntax missing error   c)nothing d)misplaced else

22)
1.#include<stdio.h>
int main(){
    int i,j;
    i=j=(2,3),0;
    while(--i&&j++)
         printf(" %d %d",i,j);
    return 0;
}
a)1 3     b)none  c)13  02  d)24 25

23)
. int main()
{
            int i=1,n;
            clrscr();
            for(i=0,n=0;i<=5;n+=i++);
            printf("%d",n);
}

a)25      b)21      c)garbage          d)15
24)
#include<stdio.h>
main()
{
  char not=!EOF;
  clrscr();
  printf("\n%d %d",EOF,not);
}
a. 0 0    b.error  c.-1 0   d.-1 1

25)
Int a=2;
a=a++ + ~++a;
a value is?
a)      0         b)1   c)-1   d)2

26)
 void main()
                {           while(1,2,'a',0)
                                {
                                                printf("abc");
                                }
                                printf(" def");
                }

a)abc def   b)error   c) def   d)abc abc abc def
27) void main()
{
int a=4,b=6;
if(++a==--b && 1)
printf("\ntrue");
else;
printf(" false");
}
a)true   b)false   c)true false  d)error
28)
main()
{
                printf(“RISE_ONGOLE”+4);
}
a)         RISE     b)RISE_    c)_ONGOLE   d) error

29)main()
{
enum {india,is=7,great};
printf(“%d%d”,india,great);
}
a)      7 1  b)7 8        c) 1  2    d)erro



30)  main() {
printf(“%d”,7>3>2?10:20<4?0:1);
a)      0    b) 1    c)  10      d) error

-------------------------------Think Globally & Get Locally Ur RVS  ------------------------------------