Horje
convert c program to c++ online Code Example
convert c program to c++ online
#include <iostream>
using namespace std;
int main()
{
    int input,count=0;
    scanf("%d",&input);
    for (int i=1; i<=input; i++)
    {        
        for (int j=1; j<=i; j++)
        {
            if (i%j==0) count++;
        }
        printf("%d ",count);
        count = 0;    
    }
}
convert c program to c++ online
#include < stdio.h>
#include<conio.h>
void main()
{
int f[50], i, st, len, j, c, k, count = 0;
clrscr();
for(i=0;i<50;i++)
f[i]=0;
printf("Files Allocated are : \n");
x: count=0;
printf(“Enter starting block and length of files: ”);
scanf("%d%d", &st,&len);
for(k=st;k<(st+len);k++)
if(f[k]==0)
count++;
if(len==count)
{
for(j=st;j<(st+len);j++)
if(f[j]==0)
{
f[j]=1;
printf("%d\t%d\n",j,f[j]);
}
if(j!=(st+len-1))
printf(” The file is allocated to disk\n");
}
else
printf(” The file is not allocated \n");
printf("Do you want to enter more file(Yes - 1/No - 0)");
scanf("%d", &c);
if(c==1)
goto x;
else
exit();
getch();
}
convert c program to c++ online
// C code stored in geeks.c file
#include <stdio.h>

// global string
char s[] = "GeeksforGeeks";

// Driver Code
int main()
{
	// Declaring variables
	int a = 2000, b =17;
	
	// Printing statement
	printf("%s %d \n", s, a+b);
}
convert c program to c++ online
#include<stdio.h> 
 
int main(){ 
	int i; char ch; 
	for( i = 1, ch = 'A';  i < 27 ; i++, ch++ ) 
	{ 
		printf("%d%c ", i,ch); 
	} 
 
	return 0; 
} 
convert c program to c++ online
#include <stdio.h>

int main(void) {
  printf("The quick brown fox \n jumps\n Over a lazy dog");
  return 0;
}
convert c program to c++ online
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <string.h>
#include <sys/types.h>
 
int main()
{
    int i;
    unsigned char toSend[102],mac[6];
    struct sockaddr_in udpClient, udpServer;
    int broadcast = 1 ;
convert c program to c++ online
#include <stdio.h>
#include <conio.h>
#include <math.h>

int main()
{
    int g, s, a, r, w;
    char response[5];

    g = 10.00;
    a = 2.00;
    s = 15.00;
    r = g + a + s;
    w = g + a;

    printf("This is your firs-class mail. Do you want special delivery? \n Enter Y or N: ");
    scanf("%s", response);
    if (response == "Y"){
        printf("Your cost is %d", r);
    }
    else (response == "N");{
        printf("Your cost is %d", w);
    }
    return 0;
}
convert c program to c++ online
#include <stdio.h>
void main(void)
{
 float cm, inches;
 printf("Enter a length in cm : ");
 scanf("%f",&cm);
 inches = cm / 2.54;
 printf("Length in inches is %f \n", inches);
} 
convert c program to c++ online
#include <stdio.h>

int main(void) {
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int p;
        scanf("%d",&p);
        printf("%d\n",p/2+1);
    }
	
	return 0;
}
convert c program to c++ online
#include<stdio.h> 
 
int main(){ 
	int i; char ch; 
	for( i = 1, ch = 'A';  i < 27 ; i++, ch++ ) 
	{ 
		printf("%d%c ", i,ch); 
	} 
 
	return 0; 
} 




Cpp

Related
javascript loop through array Code Example javascript loop through array Code Example
map update field elixir Code Example map update field elixir Code Example
c++ declare binary number Code Example c++ declare binary number Code Example
Array Rotate in c++ Code Example Array Rotate in c++ Code Example
C++ language Code Example C++ language Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9