Subscribe this Blog

Wikipedia

Search results

Notifications and New Posts!

Tuesday, October 6, 2020

Google Meet Session - 6th Oct. September 2020- Basic Programming language lectures for BE-Mechanical for TCS

 Basic Programming Language Lectures for BE-Mechanical for TCS

Tuesday, 6 October15:30 – 16:30
Daily, until 20 Oct 2020
Join with Google Meet
https://meet.google.com/mje-ucxt-wry
Description:
TCS has started hiring for Season-2021 and Coding is one of the screening round of the process.
As coding practice is essential for Mechanical Students.

Thanks & Regards

Mr. Avinash Mote | Dean TPII (Training, Placement & Industry Interaction)

Training & Placement Department

SVERI’s C.O.E. Pandharpur (PAH Solapur University)

 "Engineering for Excellence" 

 Mob - 8698303387, 9403084879

Web- http://www.sveri.ac.in
Mail – placement@sveri.ac.in
 | aamote@coe.sveri.ac.in

Note: Please join at sharp timing. 5 minutes late coming will be allowed. After that you will not be allowed in the Google Meet Session.

Please help me and yourself.

Regards,

  1. Sachin Bhosale

Due to some technical issue, Google Meet Video Session has not been recorded!! And facebook allowed me to broadcast this session for 07:41 minutes. Sorry for the same.

Unfortunately!!
OBS got stopped due to Network issue. I could not Broadcast Live session.
But this was great learning for me!!!
I tried to use Google Meet, Facebook Live and OBS together but system became very slow.
Small Experiment got failed!!!
But session was conducted through Google Meet 😊. One more thing, I forgot to mark attendance for this session.

 

I discussed this issue with Prof. Antosh Dyade sir, as per his views there can be two issues:
1. RAM should be greater than or equal to 8GB for system.
2. Graphics Card is required for the Computer.
This is for your information. At the end internet connectivity got disconnected!!

Just I am sharing programs which have been discussed in the session. This will definitely help you get connected. Once again sorry for todays inconvenience.

/*A C program to display Welcome message on output screen*/
#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
printf("\n Welcome");
getch();
}
/*
Ouput:
 Welcome
*/

/*Specific Program Example*/
/*A C program to perform addition of two integer numbers*/
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
a=10;
b=20;
c=a+b;
printf("\n Addition of a and b=%d",c);
getch();
}
/*
Ouput:

 Addition of a and b=30
*/

/*
Generalized program
*/
/*A C program to display Welcome message on output screen*/
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("\n Please enter value of a=");
scanf("%d",&a);
printf("\n Please enter value of b=");
scanf("%d",&b);
c=a+b;
printf("\n Addition of a and b=%d",c);
getch();
}
/*
Ouput:

 Please enter value of a=3

 Please enter value of b=4

 Addition of a and b=7
*/

/*
Generalized program
*/
/*A C program to calculate area of circle*/
#include<stdio.h>
#include<conio.h>
void main()
{
float r,ac,pi;
clrscr();
printf("\n Please enter Radius=");
scanf("%f",&r);
pi=3.141516;
ac=pi*r*r;
printf("\n Area of cirlce=%f",ac);
printf("\n Area of cirlce(with two decimal accuracy)=%.2f",ac);

pi=3.14716;
ac=pi*r*r;
printf("\n Area of cirlce=%f",ac);
printf("\n Area of cirlce(with two decimal accuracy)=%.2f",ac);
getch();
}
/*
Output:

 Please enter Radius=1

 Area of cirlce=3.141516
 Area of cirlce(with two decimal accuracy)=3.14
 Area of cirlce=3.147160
 Area of cirlce(with two decimal accuracy)=3.15
*/

/*
Generalized program
*/
/*A C program to character input*/
#include<stdio.h>
#include<conio.h>
void main()
{
char a;
clrscr();
printf("\n Please enter single character through keyboard=");
scanf("%c",&a);
printf("\n Your entered character=%c",a);
getch();
}
/*
Output:

 Please enter single character through keyboard=#

 Your entered character=#
*/

/*A C program to understand initialization of variables*/
#include<stdio.h>
#include<conio.h>
void main()
{
int x;
float y;
char z;
clrscr();
x=1;
y=1.5;
z='#';
printf("\n x=%d",x);
printf("\n y=%f",y);
printf("\n z=%c",z);
getch();
}
/*
Output:

 x=1
 y=1.500000
 z=#
*/

/*
A C program to understand assignment operator
and
Lvalue Required Error
*/
#include<stdio.h>
#include<conio.h>
void main()
{
int a;
clrscr();
3=a;
//a=3;
printf("\n a=%d",a);
getch();
}
/*
Error: Lvalue Required
*/

/*
A C program to understand arithmetic operators
*/
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
a=20;
b=5;
printf("\na=%d\nb=%d",a,b);
printf("\nAddition=%d",a+b);
printf("\nSubtraction=%d",a-b);
printf("\nMultiplication=%d",a*b);
printf("\nDivision=%d",a/b);
printf("\nRemainder=%d",a%b);
//Note: % - can not work with fractional value
getch();
}
/*
Output:
a=20
b=5
Addition=25
Subtraction=15
Multiplication=100
Division=4
Remainder=0
*/

/*
A C program to understand relational operators
Note: Relational operators are used to write one single logical condition.
*/
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
a=20;
b=5;
printf("\na=%d\nb=%d",a,b);
printf("\n> Operator:%d",a>b);
printf("\n< Operator:%d",a<b);
printf("\n>= Operator:%d",a>=b);
printf("\n<= Operator:%d",a<=b);
printf("\n== Operator:%d",a==b);
printf("\n!= Operator:%d",a!=b);
getch();
}
/*
Output:

a=20
b=5
> Operator:1
< Operator:0
>= Operator:1
<= Operator:0
== Operator:0
!= Operator:1
*/

/*
A C program to understand Logical operators
Note: Logical operators are used to combine more than one logical conditions.
Non zero value means 1.
Result 1 means True
Result 0 menas False
*/
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,d;
clrscr();
a=20;
b=5;
c=0;
d=-4;
printf("\na=%d\nb=%d",a,b);
printf("\n&& Operator (a==20&&b==5):%d",a==20&&b==5);
printf("\n|| Operator(a>b||a==b):%d",a>b||a==b);
printf("\n|| Operator (a<=b||a==b):%d",a<b||a==b);

printf("\n! Operator (!(a==20&&b==5)):%d",!(a==20&&b==5));
printf("\n! Operator(!(a>b||a==b)):%d",!(a>b||a==b));
printf("\n! Operator (!(a<=b||a==b)):%d",!(a<=b||a==b));

printf("\n! Operator (!a):%d",!a);
printf("\n! Operator(!b):%d",!b);
printf("\n! Operator (!c):%d",!c);
printf("\n! Operator (!d):%d",!d);
getch();
}
/*
Output:

a=20
b=5
&& Operator (a==20&&b==5):1
|| Operator(a>b||a==b):1
|| Operator (a<=b||a==b):0
! Operator (!(a==20&&b==5)):0
! Operator(!(a>b||a==b)):0
! Operator (!(a<=b||a==b)):1
! Operator (!a):0
! Operator(!b):0
! Operator (!c):1
! Operator (!d):0
*/

/*
A C program to understand Bitwise operators
Truth Table of XOR
T&T=0
T&F=1
F&T=1
F&F=0
*/
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
a=2; //a in binary  0010
b=3; //b in binary  0011
printf("\n a=%d\n b=%d",a,b);
c=a&b;//bitwise AND
printf("\n Value of c, c=a&b is %d",c);
c=a|b;//bitwise OR
printf("\n Value of c, c=a|b is %d",c);
c=a^b; //bitwise XOR
printf("\n Value of c, c=a^b is %d",c);
c=a>>1;//Right shift operator
printf("\n Value of c, c=a>>1 is %d",c);
c=a<<1;//Left shift operator
printf("\n Value of c, c=a<<1 is %d",c);

c=b>>1;//Right shift operator
printf("\n Value of c, c=b>>1 is %d",c);
c=b<<1;//Left shift operator
printf("\n Value of c, c=b<<1 is %d",c);

getch();
}
/*
Output:

 a=2
 b=3
 Value of c, c=a&b is 2
 Value of c, c=a|b is 3
 Value of c, c=a^b is 1
 Value of c, c=a>>1 is 1
 Value of c, c=a<<1 is 4
 Value of c, c=b>>1 is 1
 Value of c, c=b<<1 is 6
*/

/*
A C program to understand increment and decrement operators
++
--
pre-increment ++i
post-increment i++
pre-decrement --i
post-decrement i--
*/
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,d;
int e,f,g,h;
clrscr();
a=2;
b=2;
c=2;
d=2;

//First Part Commenting

//pre-increment ++i
++a;
//post-increment i++
b++;
//pre-decrement --i
--c;
//post-decrement i--
d--;
//Let's print values of a,b,c and d
printf("\n a=%d,b=%d,c=%d,d=%d",a,b,c,d);

//Second Part Commenting
/*
e=++a;
f=b++;
g=--c;
h=d--;
printf("\n e=%d,f=%d,g=%d,h=%d",e,f,g,h);
*/
getch();
}
/*
Output with Second part commenting

 a=3,b=3,c=1,d=1

Output with first part commenting

 e=3,f=2,g=1,h=2
*/


No comments:

Post a Comment