Friday, August 31, 2018

Predict output 4 - Answer


Output of following C Programs are not very simple. These are simple but very interesting top c programs asked during viva and interviews.

Predict output of following C Programs:


Program-1

int main()
{
  printf("Hello\\rStudents");
  return 0;
}

Output: Hello\rStudents
Justification: "\" can be printed using "\\" in printf();

Program-2

int main()
{
  printf("12345\r67890");
  return 0;
}

Output: 67890 
Justification: "\r" is a carriage return character; which reset the cursor position to the starting point of current line; hence 12345 printed will be replaced by 67890.

Program-3

int main()
{
  printf("12345678\r000");
  return 0;
}

Output: 00045678
Justification: "\r" is a carriage return character; which reset the cursor position to the starting point of current line; hence 123 will be replaced by 000 keeping remaining character as it is.

Program-4

int main()
{
  printf("123\\\\456");
  return 0;
}

Output: 123\\456
Justification: "\\" in a printf() will print "\"; hence "\\\\" will become "\\" in output.

Program-5

int main()
{
  float n1, n2, total;
  n1 = 5.45;
  n2 = 6.54;
  total = n1 + n2;
  printf("%f", total);
  return 0;
}

Output: 11.990000
Justification: By default floating point numbers are printed with six decimal points precision(after ".")





Monday, August 27, 2018

Predict C Program output - 4


Output of following C Programs are not very simple. These are simple but very interesting top c programs asked during viva and interviews.

Predict output of following C Programs:

Program-1

int main()
{
  printf("Hello\\rStudents");
  return 0;
}

Program-2

int main()
{
  printf("12345\r67890");
  return 0;
}

Program-3

int main()
{
  printf("12345678\r000");
  return 0;
}

Program-4

int main()
{
  printf("123\\\\456");
  return 0;
}

Program-5

int main()
{
  float n1, n2, total;
  n1 = 5.45;
  n2 = 6.54;
  total = n1 + n2;
  printf("%f", total);
  return 0;
}

Answer will be uploaded soon...


Saturday, August 25, 2018

Predict C Program Output-3 Answer


Program-1

#include<stdio.h>
int main()
{
  float num=65;
  printf("Size of(num) = %d",printf("65"));
  return 0;
}

Output: 65Size of(num) = 2

Justification: printf("65") written inside will be executed first; hence it prints 65. Also it returns 2 as two characters are printed, which will be printed as a value of %d.


* * * * *
Program-2

#include<stdio.h>
int main()
{
  int number = 97 ;
  printf("%c",number);
  return 0;
}

Output: a

Justification: 'a'  is the corresponding character of ASCII value 97; hence output is a.

* * * * *
Program-3

#include<stdio.h>
int main()
{
  char ch = '0' ;
  printf("%d", ch);
  return 0;
}

Output: 48

Justification: '48'  is the corresponding ASCII value of character '0' (Zero); and format specifier is %d hence output is 48.

* * * * *

Program-4

#include<stdio.h>
int main()
{
  char ch = 0 ;
  printf("%d", ch);
  return 0;
}

Output: 0

Justification: is assigned as a number zero to ch; and format specifier is %d hence output is 0.

* * * * *

Program-5

#include<stdio.h>
#define int char
int main()
{
  int num=65;
  printf("Size of(num) = %d",sizeof(num));
  return 0;
}

Output: Size of(num) = 1

Justification: #define replaces int with char; hence num will be declared as char type variable; hence output is Size of(num) = 1.


Friday, August 24, 2018

Predict C Program Output - 3


Predict the output of following C Programs.

Program-1

#include<stdio.h>
int main()
{
  float num=65;
  printf("Size of(num) = %d",printf("65"));
  return 0;
}


* * * * *
Program-2

#include<stdio.h>
int main()
{
  int number = 97 ;
  printf("%c",number);
  return 0;
}


* * * * *
Program-3

#include<stdio.h>
int main()
{
  char ch = '0' ;
  printf("%d", ch);
  return 0;
}


* * * * *

Program-4

#include<stdio.h>
int main()
{
  char ch = 0 ;
  printf("%d", ch);
  return 0;
}


* * * * *

Program-5

#include<stdio.h>
#define int char
int main()
{
  int num=65;
  printf("Size of(num) = %d",sizeof(num));
  return 0;
}


Check your Answer here...



Tuesday, August 14, 2018

Flowchart to check odd even number using Raptor


Odd Even Flowchart using RAPTOR

Raptor is one of the top flowcharts drawing tool. [ Click here to know more about RAPTOR ].

Following is the flowchart to check odd even number drawn in RAPTOR.

Fig. Odd Even Flowchart in RAPTOR

One of the great feature of RAPTOR is you can run/execute your flowchart.

When you run this flowchart in RAPTOR, it will ask you to enter a number; if we enter 5; it will display "It's Odd Number" as output.

Check more operation flowchart on following link:



Friday, August 3, 2018

Flowchart to Print Table of 5


RAPTOR Flowchart to print Table of 5

RAPTOR Flowchart to print Table of 5
Figure: RAPTOR Flowchart to Print Table of 5
Output of the Flowchart under RAPTOR is as under:

Figure: Output - Flowchart of Table of 5 in RAPTOR




Sunday, July 15, 2018

Top 10 Universities of India 2018



The National Institutional Ranking Framework (NIRF) has been accepted by the MHRD and launched by Honourable Minister for Human Resource development, Govt. of India on 29th September 2015. This framework outlines a methodology to rank institutions across the country. According to rank given by NIRF, the top 10 university of India are as under:

Top 10 Universities of India - 2018

Rank
Name
City
State
Score
1
Indian Institute of Science
Bengaluru
Karnataka
82.16
2
Jawaharlal Nehru University
New Delhi
Delhi
67.57
3
Banaras Hindu University
Varanasi
Uttar Pradesh
63.52
4
Anna University
Chennai
Tamil Nadu
62.82
5
University of Hyderabad
Hyderabad
Telangana
60.54
6
Jadavpur University
Kolkata
West Bengal
59.68
7
University of Delhi
Delhi
Delhi
58.69
8
Amrita Vishwa Vidyapeetham
Coimbatore
Tamil Nadu
58.46
9
Savitribai Phule Pune University
Pune
Maharashtra
58.24
10
Aligarh Muslim University
Aligarh
Uttar Pradesh
57.78
[ Reference: https://www.nirfindia.org/2018/UniversityRanking.html ]



Top 10 Engineering Colleges of India - 2018

Rank
Name
City
State
Score
1
Indian Institute of Technology Madras
Chennai
Tamil Nadu
88.95
2
Indian Institute of Technology Bombay
Mumbai
Maharashtra
84.82
3
Indian Institute of Technology Delhi
New Delhi
Delhi
82.18
4
Indian Institute of Tech.,  Kharagpur
Kharagpur
West Bengal
77.78
5
Indian Institute of Technology Kanpur
Kanpur
Uttar Pradesh
75.24
6
Indian Institute of Technology Roorkee
Roorkee
Uttarakhand
72.57
7
Indian Institute of Tech., Guwahati
Guwahati
Assam
69.25
8
Anna University
Chennai
Tamil Nadu
67.04
9
Indian Institute of Tech., Hyderabad
Hyderabad
Telangana
60.87
10
Institute of Chemical Technology
Mumbai
Maharashtra
60.63
[ Reference: https://www.nirfindia.org/2018/EngineeringRanking.html ]
For more details visit official website of NIRF.

* * * * *