Answers:
#include<studio.h>
int a=50;
int b=34;
void sub()
{
int diff;
diff=a-b;
printf("diff of a and b is %d\n,diff);
}
int main ()
{
Sub();
return 0;
}
#include<iostream>
using namespace std;
int a=50;
int b=34;
void sub()
{
int diff;
diff=a-b;
cout<<"diff of a and b is "<<diff<<"\n";
}
int main ()
{
Sub();
return 0;
}
<span style="background-color: rgb(255, 255, 255); color: rgb(34, 34, 34);">//assignment 1</span>
<span style="background-color: rgb(255, 255, 255); color: rgb(34, 34, 34);">#include<stdio.h></span>
int main()
{
printf("welcome to the world of C ");
return 0;
}
//Output: welcome to the world of C
Ans: cursor will blink on tha line only
Assignment 1
name : manasi kasar
#include<stdio.h>
int main()
{
printf("welcome to the world of c");
return 0;
}
//output:
welcome to the world of c
ans: there is no change without using or using '\n' in the ''printf''
statement,both output are same because there is single printf
//assignment 1
#include<stdio.h>
int main( )
{
Printf("Welcome to the World of C") ;
return 0;
}
//output:Welcome to the World of C
Ans:cursor will blink on that line only.
#include<stdio.h>
void main()
{
int a, b, diff;
clrscr();
printf ("enter the value of a, b") ;
scanf ("%d%d", &a,&b) ;
diff=a-b;
printf ("diff=%d", diff) ;
getch() ;
}
#include<stdio.h>
int a=9;
int b=4;
void sub()
{
int sub;
Sub=a-b;
printf ("sub of a and b is%d\n", sub) ;
}
int main()
{
Sub() ;
return 0;
}
#include<iostream>
using namespace std;
int a=30;
int b=25;
void sub()
{
int diff;
diff=a-b;
cout<<"diff of a and b is "<<diff<<"\n";
}
int main ()
{
Sub();
return 0;
}
Output is as follows
diff of a and b is 5
#include<studio.h>
<span class="meta">int a=30;
int b=25;
void sub()
{
int diff;
diff=a-b;
printf("diff of a and b is %d\n,diff);
}
int main ()
{
Sub();
return 0;
}
</span>
Output is as follow
diff of a and b is 5
//assignment 1
#include<stdio.h>
Int main()
{
Print f("welcome to the world of c");
return 0;
}
//output:Welcome to the world of c
And: cursor will blink on the link only.
// Assignment 5
// c program to check the difference between two number
#include<stdio.h>
void main()
{
int a, b, diff;
printf(" enter the value of a and b\n");
scanf("%d%d", &a, &b);
diff=a-b;
printf("diff of a and b is =%d", diff);
getch();
}
Output as follows
a=10
b=5
diff of a and b is=5
// Assignment 5
// c++ program to check the difference between two number
#include<iostream>
using namespace std ;
int a=10;
int b=5;
void sub()
{
int diff;
diff=a-b;
cout<<"diff of a and b is"<<diff<<"\n";
}
int main()
{
sub();
return 0;
}
Output as follows
diff of a and b is 5
#include<stdio.h>
void main()
{
int a,b,diff;
clrscr();
printf("enter the value of a and b");
scanf ("%d%d",&a ,&b);
diff=a-b;
printf("diff of a and b is=%d", diff);
getch();
}
Output is as follows
a=10
b=20
diff of a and b is =10
#include<iostream>
using namespace std;
int a=10;
int b=20;
void sub()
{
int diff;
diff=a-b;
cout<<"diff of a and b is"<<diff<<"\n";
}
int main ()
{
sub();
return 0;
}
Output is as follows
diff of a and b is 10
#include<stdio.h>
void main ()
{
int a,b,diff;
clrscr();
printf ("enter the value of a and b");
scanf ("%d%d",&a,&b);
diff=a-b;
printf("diff of a and b is =%d",diff);
getch ();
}
Output of this program will be
a=10
b=5
diff of a and b is =5
#include<iostream>
using namespace std;
int a=10;
int b=5;
void main ()
{
int diff;
diff=a-b;
cout<<"diff of a and b is "<<diff<<"\n";
}
int main ()
{
sub ();
return 0;
}
Output of this program will be
diff of a and b is 5
// Assignment 1
#include<stdio.h>
{
printf("Welcome to the world of C");
return 0;
}
// output : Welcome to the world of C
Ans : Cursor will blink on that line
// Assignment 1
#include<stdio.h>
{
printf("Welcome to the world of C");
return 0;
}
// output : Welcome to the world of C
Ans : Cursor will blink on that line
// Assignment 1
#include<stdio.h>
{
printf("Welcome to the world of C");
return 0;
}
// output : Welcome to the world of C
Ans : Cursor will blink on that line
#include<iostream>
using namespace std;
int a=25;
int b=10;
void main()
{
int diff;
diff=a-b;
cout<<"diff of a and b is"<<diff<<"\n";
}
int main()
{
sub();
return 0;
}
*****Output*****
diff of a and b is 15
#include<iostream>
using namespace std;
int a=10;
int b=5;
void main ()
{
int diff;
diff=a-b;
cout<<"diff of a and b is "<<diff<<"\n";
}
int main ()
{
sub ();
return 0;
}
Output of this program will be
diff of a and b is 5
#include<stdio.h>
void main ()
{
int a,b,diff;
clrscr();
printf ("enter the value of a and b");
scanf ("%d%d",&a,&b);
diff=a-b;
printf("diff of a and b is =%d",diff);
getch ();
}
Output of this program will be
a=10
b=5
diff of a and b is =5
#include<studio.h>
main()
{
int a,b,d;
//d for difference between two numbers
Printf("enter a value of a and b "\n);
scanf("%d%d",&a,&b);
d=a-b;
Printf("difference of a and b is=%d",d);
getch();
C++
#include<iostream>
Using namespace std;
void main()
{
Int a =15 , b=5;
Int sub;
Sub=a-b;
cout<<"difference of a and b is"<<sub<<"\n";
}
Int main ()
}
sub ()
}
// C program to calculate student result using if else statements//
#include<stdio.h>
#include<conio.h>
int main()
int phy,chem,math,total;
float percent;
printf("Enter mks of phy chem math\n");
scanf("%d%d%d",&phy ,&chem,&math);
total= phy+chem+math;
Percent= total/3;
Printf ("total is %d\n",total);
Printf("percent is %f", percent);
If(percent>35)
{
Printf("student is pass\n");
}
Else
{
Printf("student is fail\n");
}
return 0;
}
Assignment 1
// C program to calculate area of rectangle//
#include<stdio.h>
#include<conio.h>
int main()
{
int l,b ,area;
printf (" Enter length and breadth of rectangle\n");
scanf("%d%d",&l,&b);
area= l*b;
printf("area is %d",area);
return 0;
}
Assignment 2
Login to add comment
#include<studio.h>
int a=50;
int b=34;
void sub()
{
int diff;
diff=a-b;
printf("diff of a and b is %d\n,diff);
}
int main ()
{
Sub();
return 0;
}
#include<studio.h>
int a=50;
int b=34;
void sub()
{
int diff;
diff=a-b;
printf("diff of a and b is %d\n,diff);
}
int main ()
{
Sub();
return 0;
}
#include<studio.h>
int a=50;
int b=34;
void sub()
{
int diff;
diff=a-b;
printf("diff of a and b is %d\n,diff);
}
int main ()
{
Sub();
return 0;
}
#include<studio.h>
int a=50;
int b=34;
void sub()
{
int diff;
diff=a-b;
printf("diff of a and b is %d\n,diff);
}
int main ()
{
Sub();
return 0;
}
#include<studio.h>
int a=50;
int b=34;
void sub()
{
int diff;
diff=a-b;
printf("diff of a and b is %d\n,diff);
}
int main ()
{
Sub();
return 0;
}
//c program to print the difference of two numbers
#include<studio.h>int a=50;
int b=34;
void sub()
{
int diff;
diff=a-b;
printf("diff of a and b is %d\n,diff);
}
int main ()
{
Sub();
return 0;
}
#include<studio.h>
int a=50;
int b=34;
void sub()
{
int diff;
diff=a-b;
printf("diff of a and b is %d\n,diff);
}
int main ()
{
Sub();
return 0;
}
#include<studio.h>
int a=60;
int b=44;
void sub()
{
int diff;
diff=a-b;
printf("diff of a and b is %d\n,diff);
}
int main ()
{
Sub();
return 0;
}
//c program to print the difference of two numbers
#include<studio.h>
int a=50;
int b=34;
void sub()
{
int diff;
diff=a-b;
printf("diff of a and b is %d\n,diff);
}
int main ()
{
Sub();
return 0;
}
Login to add comment